This is so admins can overrule flags and always have the final say in whether a post is approved, even in the event of coordinated or sockpuppet flagging. Fixes #4980: Way to mark flags as invalid for admins
12 lines
182 B
Ruby
12 lines
182 B
Ruby
# frozen_string_literal: true
|
|
|
|
class PostApprovalPolicy < ApplicationPolicy
|
|
def create?
|
|
user.is_approver?
|
|
end
|
|
|
|
def can_bypass_approval_limits?
|
|
user.is_admin?
|
|
end
|
|
end
|