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
82d535cc
Commit
82d535cc
authored
Mar 04, 2020
by
Sebastian Arcila Valenzuela
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add admin ldap setting policy rule
parent
46fb3939
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
14 additions
and
2 deletions
+14
-2
ee/app/policies/ee/group_policy.rb
ee/app/policies/ee/group_policy.rb
+4
-2
ee/spec/policies/group_policy_spec.rb
ee/spec/policies/group_policy_spec.rb
+10
-0
No files found.
ee/app/policies/ee/group_policy.rb
View file @
82d535cc
...
...
@@ -134,8 +134,10 @@ module EE
rule
{
admin
|
owner
}.
enable
:admin_group_saml
rule
{
admin
|
(
can_owners_manage_ldap
&
owner
)
}.
enable
:admin_ldap_group_links
rule
{
admin
|
(
can_owners_manage_ldap
&
owner
)
}.
policy
do
enable
:admin_ldap_group_links
enable
:admin_ldap_group_settings
end
rule
{
ldap_synced
&
~
owners_bypass_ldap_lock
}.
prevent
:admin_group_member
...
...
ee/spec/policies/group_policy_spec.rb
View file @
82d535cc
...
...
@@ -273,6 +273,7 @@ describe GroupPolicy do
it
{
is_expected
.
to
be_disallowed
(
:override_group_member
)
}
it
{
is_expected
.
to
be_allowed
(
:admin_ldap_group_links
)
}
it
{
is_expected
.
to
be_allowed
(
:admin_ldap_group_settings
)
}
context
'does not allow group owners to manage ldap'
do
before
do
...
...
@@ -280,6 +281,7 @@ describe GroupPolicy do
end
it
{
is_expected
.
to
be_disallowed
(
:admin_ldap_group_links
)
}
it
{
is_expected
.
to
be_disallowed
(
:admin_ldap_group_settings
)
}
end
end
...
...
@@ -288,6 +290,7 @@ describe GroupPolicy do
it
{
is_expected
.
to
be_disallowed
(
:override_group_member
)
}
it
{
is_expected
.
to
be_allowed
(
:admin_ldap_group_links
)
}
it
{
is_expected
.
to
be_allowed
(
:admin_ldap_group_settings
)
}
end
end
...
...
@@ -301,6 +304,7 @@ describe GroupPolicy do
it
{
is_expected
.
to
be_disallowed
(
:override_group_member
)
}
it
{
is_expected
.
to
be_disallowed
(
:admin_ldap_group_links
)
}
it
{
is_expected
.
to
be_disallowed
(
:admin_ldap_group_settings
)
}
end
context
'guests'
do
...
...
@@ -308,6 +312,7 @@ describe GroupPolicy do
it
{
is_expected
.
to
be_disallowed
(
:override_group_member
)
}
it
{
is_expected
.
to
be_disallowed
(
:admin_ldap_group_links
)
}
it
{
is_expected
.
to
be_disallowed
(
:admin_ldap_group_settings
)
}
end
context
'reporter'
do
...
...
@@ -315,6 +320,7 @@ describe GroupPolicy do
it
{
is_expected
.
to
be_disallowed
(
:override_group_member
)
}
it
{
is_expected
.
to
be_disallowed
(
:admin_ldap_group_links
)
}
it
{
is_expected
.
to
be_disallowed
(
:admin_ldap_group_settings
)
}
end
context
'developer'
do
...
...
@@ -322,6 +328,7 @@ describe GroupPolicy do
it
{
is_expected
.
to
be_disallowed
(
:override_group_member
)
}
it
{
is_expected
.
to
be_disallowed
(
:admin_ldap_group_links
)
}
it
{
is_expected
.
to
be_disallowed
(
:admin_ldap_group_settings
)
}
end
context
'maintainer'
do
...
...
@@ -329,6 +336,7 @@ describe GroupPolicy do
it
{
is_expected
.
to
be_disallowed
(
:override_group_member
)
}
it
{
is_expected
.
to
be_disallowed
(
:admin_ldap_group_links
)
}
it
{
is_expected
.
to
be_disallowed
(
:admin_ldap_group_settings
)
}
end
context
'owner'
do
...
...
@@ -345,6 +353,7 @@ describe GroupPolicy do
it
{
is_expected
.
to
be_disallowed
(
:override_group_member
)
}
it
{
is_expected
.
to
be_disallowed
(
:admin_ldap_group_links
)
}
it
{
is_expected
.
to
be_disallowed
(
:admin_ldap_group_settings
)
}
end
end
...
...
@@ -353,6 +362,7 @@ describe GroupPolicy do
it
{
is_expected
.
to
be_allowed
(
:override_group_member
)
}
it
{
is_expected
.
to
be_allowed
(
:admin_ldap_group_links
)
}
it
{
is_expected
.
to
be_allowed
(
:admin_ldap_group_settings
)
}
end
context
'when memberships locked to LDAP'
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