BigW Consortium Gitlab

issuable_policy.rb 278 Bytes
Newer Older
1 2 3 4 5 6
class IssuablePolicy < BasePolicy
  def action_name
    @subject.class.name.underscore
  end

  def rules
Yorick Peterse committed
7
    if @user && @subject.assignee_or_author?(@user)
8 9 10 11 12 13 14
      can! :"read_#{action_name}"
      can! :"update_#{action_name}"
    end

    delegate! @subject.project
  end
end