2015-03-18 22:02:38 +00:00
|
|
|
class TokenPolicy < ApplicationPolicy
|
|
|
|
|
|
|
|
def show?
|
2015-04-03 22:37:37 +01:00
|
|
|
# local_admin?(record.subject)
|
|
|
|
is_admin? || owner?(record.subject) || local_admin?(record.subject)
|
2015-03-18 22:02:38 +00:00
|
|
|
end
|
|
|
|
alias_method :create?, :show?
|
|
|
|
alias_method :read?, :show?
|
|
|
|
alias_method :withdraw?, :show?
|
|
|
|
|
2015-05-20 22:52:50 +01:00
|
|
|
# Public: Get list of parameters that the user is allowed to alter.
|
|
|
|
#
|
|
|
|
# Returns Array
|
|
|
|
def permitted_attributes
|
|
|
|
%i(description)
|
|
|
|
end
|
|
|
|
|
2015-03-18 22:02:38 +00:00
|
|
|
end
|