debian-mirror-gitlab/app/policies/work_item_policy.rb
2022-04-04 11:22:00 +05:30

12 lines
277 B
Ruby

# frozen_string_literal: true
class WorkItemPolicy < BasePolicy
delegate { @subject.project }
desc 'User is author of the work item'
condition(:author) do
@user && @user == @subject.author
end
rule { can?(:owner_access) | author }.enable :delete_work_item
end