mirror of
https://github.com/mastodon/mastodon.git
synced 2024-08-20 21:08:15 -07:00
f8ca3bb2a1
* Add ability to view previous edits of a status in admin UI * Change moderator access to posts to be controlled by a separate policy
29 lines
611 B
Ruby
29 lines
611 B
Ruby
# frozen_string_literal: true
|
|
|
|
class Admin::StatusPolicy < ApplicationPolicy
|
|
def initialize(current_account, record, preloaded_relations = {})
|
|
super(current_account, record)
|
|
|
|
@preloaded_relations = preloaded_relations
|
|
end
|
|
|
|
def index?
|
|
role.can?(:manage_reports, :manage_users)
|
|
end
|
|
|
|
def show?
|
|
role.can?(:manage_reports, :manage_users) && (record.public_visibility? || record.unlisted_visibility? || record.reported?)
|
|
end
|
|
|
|
def destroy?
|
|
role.can?(:manage_reports)
|
|
end
|
|
|
|
def update?
|
|
role.can?(:manage_reports)
|
|
end
|
|
|
|
def review?
|
|
role.can?(:manage_taxonomies)
|
|
end
|
|
end
|