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
9afa80bb
Commit
9afa80bb
authored
Oct 03, 2014
by
Dmitriy Zaporozhets
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix EE code after membership refactoring
Signed-off-by:
Dmitriy Zaporozhets
<
dmitriy.zaporozhets@gmail.com
>
parent
616e05ef
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
7 additions
and
7 deletions
+7
-7
app/models/project_team.rb
app/models/project_team.rb
+1
-1
app/services/ldap_group_reset_service.rb
app/services/ldap_group_reset_service.rb
+1
-1
lib/gitlab/ldap/access.rb
lib/gitlab/ldap/access.rb
+1
-1
spec/lib/gitlab/ldap/access_spec.rb
spec/lib/gitlab/ldap/access_spec.rb
+3
-3
spec/services/ldap_group_reset_service_spec.rb
spec/services/ldap_group_reset_service_spec.rb
+1
-1
No files found.
app/models/project_team.rb
View file @
9afa80bb
...
...
@@ -187,7 +187,7 @@ class ProjectTeam
# group access is developers we need to provide
# both group master, developers as devs
if
int_level
==
group_link
.
group_access
im
.
where
(
"
group_access
>= ?)"
,
group_link
.
group_access
)
im
.
where
(
"
access_level
>= ?)"
,
group_link
.
group_access
)
else
im
.
send
(
level
)
end
...
...
app/services/ldap_group_reset_service.rb
View file @
9afa80bb
...
...
@@ -8,7 +8,7 @@ class LdapGroupResetService
a
=
group
.
members
.
with_ldap_dn
.
map
do
|
member
|
# don't unauthorize the current user
next
if
current_user
==
member
.
user
member
.
update_attribute
:
group_access
,
Gitlab
::
Access
::
GUEST
member
.
update_attribute
:
access_level
,
Gitlab
::
Access
::
GUEST
end
group
.
users
.
ldap
.
update_all
last_credential_check_at:
nil
...
...
lib/gitlab/ldap/access.rb
View file @
9afa80bb
...
...
@@ -151,7 +151,7 @@ module Gitlab
# Get the group_access for a give user.
# Always respect the current level, never downgrade it.
def
fetch_group_access
(
group
,
user
,
active_group_links
)
current_access_level
=
group
.
users_groups
.
where
(
user_id:
user
).
maximum
(
:group_access
)
current_access_level
=
group
.
group_members
.
where
(
user_id:
user
).
maximum
(
:access_level
)
max_group_access_level
=
active_group_links
.
maximum
(
:group_access
)
# TODO: Test if nil value of current_access_level in handled properly
...
...
spec/lib/gitlab/ldap/access_spec.rb
View file @
9afa80bb
...
...
@@ -258,7 +258,7 @@ objectclass: posixGroup
context
"existing access as guest for group-1, allowed via ldap-group1 as DEVELOPER"
do
before
do
gitlab_group_1
.
users_group
s
.
guests
.
create
(
user_id:
user
.
id
)
gitlab_group_1
.
group_member
s
.
guests
.
create
(
user_id:
user
.
id
)
gitlab_group_1
.
ldap_group_links
.
create
cn:
'ldap-group1'
,
group_access:
Gitlab
::
Access
::
MASTER
end
...
...
@@ -270,7 +270,7 @@ objectclass: posixGroup
context
"existing access as MASTER for group-1, allowed via ldap-group1 as DEVELOPER"
do
before
do
gitlab_group_1
.
users_group
s
.
masters
.
create
(
user_id:
user
.
id
)
gitlab_group_1
.
group_member
s
.
masters
.
create
(
user_id:
user
.
id
)
gitlab_group_1
.
ldap_group_links
.
create
cn:
'ldap-group1'
,
group_access:
Gitlab
::
Access
::
DEVELOPER
end
...
...
@@ -282,7 +282,7 @@ objectclass: posixGroup
context
"existing access as master for group-1, not allowed"
do
before
do
gitlab_group_1
.
users_group
s
.
masters
.
create
(
user_id:
user
.
id
)
gitlab_group_1
.
group_member
s
.
masters
.
create
(
user_id:
user
.
id
)
gitlab_group_1
.
ldap_group_links
.
create
cn:
'ldap-group1'
,
group_access:
Gitlab
::
Access
::
MASTER
access
.
stub
(
cns_with_access:
[
'ldap-group2'
])
end
...
...
spec/services/ldap_group_reset_service_spec.rb
View file @
9afa80bb
...
...
@@ -37,6 +37,6 @@ describe LdapGroupResetService do
end
def
member_access
(
user
)
group
.
members
.
find_by
(
user_id:
user
).
group_access
group
.
members
.
find_by
(
user_id:
user
).
access_level
end
end
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