diff options
Diffstat (limited to 'app/policies/work_item_policy.rb')
-rw-r--r-- | app/policies/work_item_policy.rb | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/app/policies/work_item_policy.rb b/app/policies/work_item_policy.rb index 1ccc152bc6b..23b1d54b3bf 100644 --- a/app/policies/work_item_policy.rb +++ b/app/policies/work_item_policy.rb @@ -1,13 +1,14 @@ # frozen_string_literal: true class WorkItemPolicy < IssuePolicy + condition(:is_member) { is_project_member? } condition(:is_member_and_author) { is_project_member? & is_author? } rule { can?(:admin_issue) }.enable :admin_work_item - rule { can?(:destroy_issue) | is_member_and_author }.enable :delete_work_item rule { can?(:update_issue) }.enable :update_work_item + rule { can?(:set_issue_metadata) }.enable :set_work_item_metadata rule { can?(:read_issue) }.enable :read_work_item @@ -20,4 +21,6 @@ class WorkItemPolicy < IssuePolicy rule { can?(:reporter_access) }.policy do enable :admin_parent_link end + + rule { is_member & can?(:read_work_item) }.enable :admin_work_item_link end |