summaryrefslogtreecommitdiff
path: root/app/models/ability.rb
diff options
context:
space:
mode:
Diffstat (limited to 'app/models/ability.rb')
-rw-r--r--app/models/ability.rb9
1 files changed, 6 insertions, 3 deletions
diff --git a/app/models/ability.rb b/app/models/ability.rb
index c41704f9a11..a02f44a4cb8 100644
--- a/app/models/ability.rb
+++ b/app/models/ability.rb
@@ -19,7 +19,7 @@ class Ability
:read_team_member,
:read_merge_request,
:read_note
- ] if project.readers.include?(user)
+ ] if project.allow_read_for?(user)
rules << [
:write_project,
@@ -27,16 +27,18 @@ class Ability
:write_snippet,
:write_merge_request,
:write_note
- ] if project.writers.include?(user)
+ ] if project.allow_write_for?(user)
rules << [
+ :modify_issue,
+ :modify_snippet,
:admin_project,
:admin_issue,
:admin_snippet,
:admin_team_member,
:admin_merge_request,
:admin_note
- ] if project.admins.include?(user)
+ ] if project.allow_admin_for?(user)
rules.flatten
end
@@ -48,6 +50,7 @@ class Ability
[
:"read_#{name}",
:"write_#{name}",
+ :"modify_#{name}",
:"admin_#{name}"
]
else