2017-11-12 04:23:33 +09: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 20:45:07 +09:00
|
|
|
def remove_avatar?
|
|
|
|
staff?
|
|
|
|
end
|
|
|
|
|
2018-12-12 03:28:03 +09:00
|
|
|
def remove_header?
|
|
|
|
staff?
|
|
|
|
end
|
|
|
|
|
2017-11-12 04:23:33 +09:00
|
|
|
def subscribe?
|
|
|
|
admin?
|
|
|
|
end
|
|
|
|
|
|
|
|
def unsubscribe?
|
|
|
|
admin?
|
|
|
|
end
|
|
|
|
|
|
|
|
def memorialize?
|
|
|
|
admin? && !record.user&.admin?
|
|
|
|
end
|
|
|
|
end
|