2017-11-11 19:23:33 +00:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
|
|
|
class AccountPolicy < ApplicationPolicy
|
|
|
|
def index?
|
|
|
|
staff?
|
|
|
|
end
|
|
|
|
|
|
|
|
def show?
|
|
|
|
staff?
|
|
|
|
end
|
|
|
|
|
|
|
|
def suspend?
|
|
|
|
staff? && !record.user&.staff?
|
|
|
|
end
|
|
|
|
|
|
|
|
def unsuspend?
|
|
|
|
staff?
|
|
|
|
end
|
|
|
|
|
|
|
|
def silence?
|
|
|
|
staff? && !record.user&.staff?
|
|
|
|
end
|
|
|
|
|
|
|
|
def unsilence?
|
|
|
|
staff?
|
|
|
|
end
|
|
|
|
|
|
|
|
def redownload?
|
|
|
|
admin?
|
|
|
|
end
|
|
|
|
|
2018-04-02 12:45:07 +01:00
|
|
|
def remove_avatar?
|
|
|
|
staff?
|
|
|
|
end
|
|
|
|
|
2017-11-11 19:23:33 +00:00
|
|
|
def subscribe?
|
|
|
|
admin?
|
|
|
|
end
|
|
|
|
|
|
|
|
def unsubscribe?
|
|
|
|
admin?
|
|
|
|
end
|
|
|
|
|
|
|
|
def memorialize?
|
|
|
|
admin? && !record.user&.admin?
|
|
|
|
end
|
|
|
|
end
|