1
0
Fork 0
This repository has been archived on 2023-03-27. You can view files and clone it, but cannot push or open issues or pull requests.
lpr-partynest/app/policies/staff/person/person_comment_policy.rb

24 lines
370 B
Ruby
Raw Normal View History

2019-07-15 17:56:27 -04:00
# frozen_string_literal: true
class Staff::Person::PersonCommentPolicy < ApplicationPolicy
def index?
2019-08-11 15:27:06 -04:00
account&.superuser?
2019-07-15 17:56:27 -04:00
end
2019-07-15 19:04:49 -04:00
def create?
2019-08-11 15:27:06 -04:00
account&.superuser?
2019-07-15 19:04:49 -04:00
end
def permitted_attributes_for_create
2019-07-17 04:34:51 -04:00
%i[attachment text]
2019-07-15 19:04:49 -04:00
end
2019-07-15 17:56:27 -04:00
class Scope < Scope
def resolve
2019-08-11 15:27:06 -04:00
return scope.all if account&.superuser?
2019-07-15 17:56:27 -04:00
scope.none
end
end
end