2020-05-31 22:38:19 +02:00
|
|
|
class BroadcastPolicy < ApplicationPolicy
|
|
|
|
|
def index?
|
|
|
|
|
true
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
def show?
|
|
|
|
|
true
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
def create?
|
|
|
|
|
user.manager? || user.account_manager?
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
def destroy?
|
|
|
|
|
create?
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
def update?
|
|
|
|
|
true
|
|
|
|
|
end
|
2020-07-27 10:17:56 +00:00
|
|
|
|
|
|
|
|
def destroy_file?
|
|
|
|
|
if user.nil? || user.user.nil?
|
|
|
|
|
return false
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
user.manager? || user.account_manager?
|
|
|
|
|
end
|
2020-05-31 22:38:19 +02:00
|
|
|
end
|