Welcome to mirror list, hosted at ThFree Co, Russian Federation.

issuable_policy.rb « policies « app - gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 9501e499507b966aa7086e351647a77aa2e096c8 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
class IssuablePolicy < BasePolicy
  def action_name
    @subject.class.name.underscore
  end

  def rules
    if @user && @subject.assignee_or_author?(@user)
      can! :"read_#{action_name}"
      can! :"update_#{action_name}"
    end

    delegate! @subject.project
  end
end