Merge tag 'v2.8.0' into instance_only_statuses
This commit is contained in:
7
app/policies/poll_policy.rb
Normal file
7
app/policies/poll_policy.rb
Normal file
@ -0,0 +1,7 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
class PollPolicy < ApplicationPolicy
|
||||
def vote?
|
||||
StatusPolicy.new(current_account, record.status).show? && !current_account.blocking?(record.account) && !record.account.blocking?(current_account)
|
||||
end
|
||||
end
|
||||
@ -21,6 +21,14 @@ class UserPolicy < ApplicationPolicy
|
||||
staff?
|
||||
end
|
||||
|
||||
def approve?
|
||||
staff? && !record.approved?
|
||||
end
|
||||
|
||||
def reject?
|
||||
staff? && !record.approved?
|
||||
end
|
||||
|
||||
def disable?
|
||||
staff? && !record.admin?
|
||||
end
|
||||
@ -36,7 +44,7 @@ class UserPolicy < ApplicationPolicy
|
||||
private
|
||||
|
||||
def promoteable?
|
||||
!record.staff? || !record.admin?
|
||||
record.approved? && (!record.staff? || !record.admin?)
|
||||
end
|
||||
|
||||
def demoteable?
|
||||
|
||||
Reference in New Issue
Block a user