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
ad95cc64
Commit
ad95cc64
authored
Oct 16, 2014
by
Jan-Willem van der Meer
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'feature-multi-ldap-servers-group-sync' into feature-migrate-to-multiple-ldaps
parents
104e1462
02fb3116
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
10 additions
and
5 deletions
+10
-5
spec/factories.rb
spec/factories.rb
+1
-0
spec/lib/gitlab/ldap/access_spec.rb
spec/lib/gitlab/ldap/access_spec.rb
+9
-5
No files found.
spec/factories.rb
View file @
ad95cc64
...
...
@@ -187,5 +187,6 @@ FactoryGirl.define do
cn
'group1'
group_access
Gitlab
::
Access
::
GUEST
provider
'ldapmain'
group
end
end
spec/lib/gitlab/ldap/access_spec.rb
View file @
ad95cc64
...
...
@@ -208,7 +208,7 @@ objectclass: posixGroup
context
"non existing access for group-1, allowed via ldap-group1 as MASTER"
do
before
do
gitlab_group_1
.
ldap_group_links
.
create
({
cn:
'ldap-group1'
,
group_access:
Gitlab
::
Access
::
MASTER
})
cn:
'ldap-group1'
,
group_access:
Gitlab
::
Access
::
MASTER
,
provider:
'ldapmain'
})
end
it
"gives the user master access for group 1"
do
...
...
@@ -220,7 +220,8 @@ objectclass: posixGroup
context
"existing access as guest for group-1, allowed via ldap-group1 as DEVELOPER"
do
before
do
gitlab_group_1
.
group_members
.
guests
.
create
(
user_id:
user
.
id
)
gitlab_group_1
.
ldap_group_links
.
create
cn:
'ldap-group1'
,
group_access:
Gitlab
::
Access
::
MASTER
gitlab_group_1
.
ldap_group_links
.
create
({
cn:
'ldap-group1'
,
group_access:
Gitlab
::
Access
::
MASTER
,
provider:
'ldapmain'
})
end
it
"upgrades the users access to master for group 1"
do
...
...
@@ -232,7 +233,8 @@ objectclass: posixGroup
context
"existing access as MASTER for group-1, allowed via ldap-group1 as DEVELOPER"
do
before
do
gitlab_group_1
.
group_members
.
masters
.
create
(
user_id:
user
.
id
)
gitlab_group_1
.
ldap_group_links
.
create
cn:
'ldap-group1'
,
group_access:
Gitlab
::
Access
::
DEVELOPER
gitlab_group_1
.
ldap_group_links
.
create
({
cn:
'ldap-group1'
,
group_access:
Gitlab
::
Access
::
DEVELOPER
,
provider:
'ldapmain'
})
end
it
"keeps the users master access for group 1"
do
...
...
@@ -244,7 +246,8 @@ objectclass: posixGroup
context
"existing access as master for group-1, not allowed"
do
before
do
gitlab_group_1
.
group_members
.
masters
.
create
(
user_id:
user
.
id
)
gitlab_group_1
.
ldap_group_links
.
create
cn:
'ldap-group1'
,
group_access:
Gitlab
::
Access
::
MASTER
gitlab_group_1
.
ldap_group_links
.
create
({
cn:
'ldap-group1'
,
group_access:
Gitlab
::
Access
::
MASTER
,
provider:
'ldapmain'
})
access
.
stub
(
cns_with_access:
[
'ldap-group2'
])
end
...
...
@@ -270,7 +273,8 @@ objectclass: posixGroup
end
it
"returns an interator of LDAP Groups"
do
::
LdapGroupLink
.
create
cn:
'example'
,
group_access:
Gitlab
::
Access
::
DEVELOPER
,
group_id:
42
::
LdapGroupLink
.
create
({
cn:
'example'
,
group_access:
Gitlab
::
Access
::
DEVELOPER
,
group_id:
42
,
provider:
'ldapmain'
})
Gitlab
::
LDAP
::
Adapter
.
any_instance
.
stub
(
:group
)
{
Gitlab
::
LDAP
::
Group
.
new
(
ldap_group_1
)
}
expect
(
access
.
ldap_groups
.
first
).
to
be_a
Gitlab
::
LDAP
::
Group
...
...
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