This repository has been archived on 2023-03-28. You can view files and clone it, but cannot push or open issues or pull requests.
2019-03-26 00:27:48 +00:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
|
|
|
class Staff::PersonPolicy < ApplicationPolicy
|
|
|
|
def index?
|
2019-08-11 19:27:06 +00:00
|
|
|
account&.superuser?
|
2019-03-26 00:27:48 +00:00
|
|
|
end
|
|
|
|
|
2019-03-26 22:57:37 +00:00
|
|
|
def show?
|
2019-08-11 19:27:06 +00:00
|
|
|
account&.superuser?
|
2019-03-26 22:57:37 +00:00
|
|
|
end
|
|
|
|
|
2019-08-28 17:44:39 +00:00
|
|
|
def create?
|
|
|
|
account&.superuser?
|
|
|
|
end
|
|
|
|
|
2019-03-26 00:27:48 +00:00
|
|
|
class Scope < Scope
|
|
|
|
def resolve
|
2019-08-11 19:27:06 +00:00
|
|
|
return scope.all if account&.superuser?
|
2019-03-26 00:27:48 +00:00
|
|
|
|
|
|
|
scope.none
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|