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
dcbef45d
Commit
dcbef45d
authored
Sep 01, 2016
by
Robert Speicher
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add EE-only policy modifications to GroupPolicy and ProjectPolicy
parent
60243c39
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
23 additions
and
0 deletions
+23
-0
app/policies/group_policy.rb
app/policies/group_policy.rb
+3
-0
app/policies/project_policy.rb
app/policies/project_policy.rb
+20
-0
No files found.
app/policies/group_policy.rb
View file @
dcbef45d
...
...
@@ -32,6 +32,9 @@ class GroupPolicy < BasePolicy
if
globally_viewable
&&
@subject
.
request_access_enabled
&&
!
member
can!
:request_access
end
# EE-only
cannot!
:admin_group_member
if
@subject
.
ldap_synced?
end
def
can_read_group?
...
...
app/policies/project_policy.rb
View file @
dcbef45d
...
...
@@ -23,6 +23,9 @@ class ProjectPolicy < BasePolicy
archived_access!
if
project
.
archived?
# EE-only
can!
:change_repository_storage
if
user
.
admin?
disabled_features!
end
...
...
@@ -101,6 +104,12 @@ class ProjectPolicy < BasePolicy
can!
:admin_pipeline
can!
:admin_environment
can!
:admin_deployment
# EE-only
can!
:admin_path_locks
can!
:admin_pages
can!
:read_pages
can!
:update_pages
end
def
public_access!
...
...
@@ -124,6 +133,9 @@ class ProjectPolicy < BasePolicy
can!
:remove_fork_project
can!
:destroy_merge_request
can!
:destroy_issue
# EE-only
can!
:remove_pages
end
# Push abilities on the users team role
...
...
@@ -176,6 +188,14 @@ class ProjectPolicy < BasePolicy
unless
project
.
container_registry_enabled
cannot!
(
*
named_abilities
(
:container_image
))
end
# EE-only
if
defined?
(
License
)
&&
License
.
block_changes?
cannot!
:create_issue
cannot!
:create_merge_request
cannot!
:push_code
cannot!
:push_code_to_protected_branches
end
end
def
anonymous_rules
...
...
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