Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
gitlab-ce
Commits
9230523a
Commit
9230523a
authored
Jun 16, 2017
by
Bob Van Landuyt
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Use `destroy` instead of `delete` so callbacks are triggered.
parent
c2727604
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
10 additions
and
1 deletion
+10
-1
lib/ee/gitlab/ldap/sync/group.rb
lib/ee/gitlab/ldap/sync/group.rb
+1
-1
spec/lib/ee/gitlab/ldap/sync/group_spec.rb
spec/lib/ee/gitlab/ldap/sync/group_spec.rb
+9
-0
No files found.
lib/ee/gitlab/ldap/sync/group.rb
View file @
9230523a
...
...
@@ -145,7 +145,7 @@ module EE
elsif
group
.
last_owner?
(
user
)
warn_cannot_remove_last_owner
(
user
,
group
)
else
group
.
users
.
de
lete
(
user
)
group
.
users
.
de
stroy
(
user
)
end
end
end
...
...
spec/lib/ee/gitlab/ldap/sync/group_spec.rb
View file @
9230523a
...
...
@@ -235,6 +235,15 @@ describe EE::Gitlab::LDAP::Sync::Group, lib: true do
expect
(
group
.
members
.
find_by
(
user_id:
user
.
id
).
access_level
)
.
to
eq
(
::
Gitlab
::
Access
::
OWNER
)
end
it
'updates projects authorizations'
do
project
=
create
(
:empty_project
,
namespace:
group
)
group
.
add_user
(
user
,
Gitlab
::
Access
::
MASTER
)
sync_group
.
update_permissions
expect
(
project
.
authorized_users
.
find_by
(
id:
user
.
id
)).
to
be_nil
end
end
context
'when the user is the last owner'
do
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment