mirror of
https://github.com/glitch-soc/mastodon.git
synced 2025-12-13 15:58:50 +00:00
Merge commit 'dbb20f76a781defe35d077529c8269d712c1fbd2' into glitch-soc/merge-upstream
Conflicts: - `tsconfig.json`: glitch-soc had extra paths under `app/javascript/flavours`, but upstream added `app/javascript` as a whole, so updated to upstream's.
This commit is contained in:
17
app/policies/instance_moderation_note_policy.rb
Normal file
17
app/policies/instance_moderation_note_policy.rb
Normal file
@@ -0,0 +1,17 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
class InstanceModerationNotePolicy < ApplicationPolicy
|
||||
def create?
|
||||
role.can?(:manage_federation)
|
||||
end
|
||||
|
||||
def destroy?
|
||||
owner? || (role.can?(:manage_federation) && role.overrides?(record.account.user_role))
|
||||
end
|
||||
|
||||
private
|
||||
|
||||
def owner?
|
||||
record.account_id == current_account&.id
|
||||
end
|
||||
end
|
||||
Reference in New Issue
Block a user