debian-mirror-gitlab/app/policies/issuable_policy.rb

16 lines
361 B
Ruby
Raw Normal View History

2016-09-29 09:46:39 +05:30
class IssuablePolicy < BasePolicy
2017-09-10 17:25:29 +05:30
delegate { @subject.project }
2016-09-29 09:46:39 +05:30
2017-09-10 17:25:29 +05:30
desc "User is the assignee or author"
condition(:assignee_or_author) do
@user && @subject.assignee_or_author?(@user)
end
2016-09-29 09:46:39 +05:30
2017-09-10 17:25:29 +05:30
rule { assignee_or_author }.policy do
enable :read_issue
enable :update_issue
enable :read_merge_request
enable :update_merge_request
2016-09-29 09:46:39 +05:30
end
end