This repository has been archived on 2024-06-09. You can view files and clone it, but cannot push or open issues/pull-requests.
2017-11-11 20:23:33 +01: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 13:45:07 +02:00
|
|
|
def remove_avatar?
|
|
|
|
staff?
|
|
|
|
end
|
|
|
|
|
2018-12-11 19:28:03 +01:00
|
|
|
def remove_header?
|
|
|
|
staff?
|
|
|
|
end
|
|
|
|
|
2017-11-11 20:23:33 +01:00
|
|
|
def subscribe?
|
|
|
|
admin?
|
|
|
|
end
|
|
|
|
|
|
|
|
def unsubscribe?
|
|
|
|
admin?
|
|
|
|
end
|
|
|
|
|
|
|
|
def memorialize?
|
|
|
|
admin? && !record.user&.admin?
|
|
|
|
end
|
|
|
|
end
|