Merge branch 'main' into glitch-soc/merge-upstream
Conflicts: - `db/schema.rb`: Conflict due to glitch-soc adding the `content_type` column on status edits and thus having a different schema version number. Solved by taking upstream's schema version number, as it is higher than glitch-soc's.
This commit is contained in:
@@ -0,0 +1,17 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
class AccountWarningPolicy < ApplicationPolicy
|
||||
def show?
|
||||
target? || staff?
|
||||
end
|
||||
|
||||
def appeal?
|
||||
target? && record.created_at >= Appeal::MAX_STRIKE_AGE.ago
|
||||
end
|
||||
|
||||
private
|
||||
|
||||
def target?
|
||||
record.target_account_id == current_account&.id
|
||||
end
|
||||
end
|
||||
@@ -0,0 +1,13 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
class AppealPolicy < ApplicationPolicy
|
||||
def index?
|
||||
staff?
|
||||
end
|
||||
|
||||
def approve?
|
||||
record.pending? && staff?
|
||||
end
|
||||
|
||||
alias reject? approve?
|
||||
end
|
||||
Reference in New Issue
Block a user