trabajo-afectivo/app/policies/ticket/shared_draft_start_policy.rb

28 lines
461 B
Ruby
Raw Normal View History

2022-02-24 11:33:52 +00:00
# Copyright (C) 2012-2022 Zammad Foundation, https://zammad-foundation.org/
class Ticket::SharedDraftStartPolicy < ApplicationPolicy
def create?
access?(__method__)
end
def update?
access?(__method__)
end
def show?
access?(__method__)
end
def destroy?
access?(__method__)
end
private
def access?(_method)
return if !user.permissions?('ticket.agent')
user.groups.access(:create).include? record.group
end
end