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
553fff95
Commit
553fff95
authored
Jan 14, 2021
by
Mark Chao
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add policy for managing subscriptions
parent
1622ac99
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
4 additions
and
0 deletions
+4
-0
ee/app/policies/ee/global_policy.rb
ee/app/policies/ee/global_policy.rb
+1
-0
ee/spec/policies/global_policy_spec.rb
ee/spec/policies/global_policy_spec.rb
+3
-0
No files found.
ee/app/policies/ee/global_policy.rb
View file @
553fff95
...
...
@@ -28,6 +28,7 @@ module EE
enable
:destroy_licenses
enable
:read_all_geo
enable
:manage_devops_adoption_segments
enable
:manage_subscription
end
rule
{
admin
&
pages_size_limit_available
}.
enable
:update_max_pages_size
...
...
ee/spec/policies/global_policy_spec.rb
View file @
553fff95
...
...
@@ -39,17 +39,20 @@ RSpec.describe GlobalPolicy do
it
{
is_expected
.
to
be_disallowed
(
:read_licenses
)
}
it
{
is_expected
.
to
be_disallowed
(
:destroy_licenses
)
}
it
{
is_expected
.
to
be_disallowed
(
:read_all_geo
)
}
it
{
is_expected
.
to
be_disallowed
(
:manage_subscription
)
}
context
'when admin mode enabled'
,
:enable_admin_mode
do
it
{
expect
(
described_class
.
new
(
admin
,
[
user
])).
to
be_allowed
(
:read_licenses
)
}
it
{
expect
(
described_class
.
new
(
admin
,
[
user
])).
to
be_allowed
(
:destroy_licenses
)
}
it
{
expect
(
described_class
.
new
(
admin
,
[
user
])).
to
be_allowed
(
:read_all_geo
)
}
it
{
expect
(
described_class
.
new
(
admin
,
[
user
])).
to
be_allowed
(
:manage_subscription
)
}
end
context
'when admin mode disabled'
do
it
{
expect
(
described_class
.
new
(
admin
,
[
user
])).
to
be_disallowed
(
:read_licenses
)
}
it
{
expect
(
described_class
.
new
(
admin
,
[
user
])).
to
be_disallowed
(
:destroy_licenses
)
}
it
{
expect
(
described_class
.
new
(
admin
,
[
user
])).
to
be_disallowed
(
:read_all_geo
)
}
it
{
expect
(
described_class
.
new
(
admin
,
[
user
])).
to
be_disallowed
(
:manage_subscription
)
}
end
shared_examples
'analytics policy'
do
|
action
|
...
...
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