BigW Consortium Gitlab

issuable_policy.rb 361 Bytes
Newer Older
1
class IssuablePolicy < BasePolicy
2
  delegate { @subject.project }
3

4 5 6 7
  desc "User is the assignee or author"
  condition(:assignee_or_author) do
    @user && @subject.assignee_or_author?(@user)
  end
8

9 10 11 12 13
  rule { assignee_or_author }.policy do
    enable :read_issue
    enable :update_issue
    enable :read_merge_request
    enable :update_merge_request
14 15
  end
end