Merge tag 'v3.0.0' into hometown-dev
This commit is contained in:
11
app/policies/domain_allow_policy.rb
Normal file
11
app/policies/domain_allow_policy.rb
Normal file
@ -0,0 +1,11 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
class DomainAllowPolicy < ApplicationPolicy
|
||||
def create?
|
||||
admin?
|
||||
end
|
||||
|
||||
def destroy?
|
||||
admin?
|
||||
end
|
||||
end
|
@ -19,7 +19,7 @@ class StatusPolicy < ApplicationPolicy
|
||||
elsif private?
|
||||
owned? || following_author? || mention_exists?
|
||||
else
|
||||
current_account.nil? || !author_blocking?
|
||||
current_account.nil? || (!author_blocking? && !author_blocking_domain?)
|
||||
end
|
||||
end
|
||||
|
||||
@ -65,6 +65,12 @@ class StatusPolicy < ApplicationPolicy
|
||||
end
|
||||
end
|
||||
|
||||
def author_blocking_domain?
|
||||
return false if current_account.nil? || current_account.domain.nil?
|
||||
|
||||
author.domain_blocking?(current_account.domain)
|
||||
end
|
||||
|
||||
def blocking_author?
|
||||
return false if current_account.nil?
|
||||
|
||||
|
@ -1,7 +0,0 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
class SubscriptionPolicy < ApplicationPolicy
|
||||
def index?
|
||||
admin?
|
||||
end
|
||||
end
|
@ -5,11 +5,11 @@ class TagPolicy < ApplicationPolicy
|
||||
staff?
|
||||
end
|
||||
|
||||
def hide?
|
||||
def show?
|
||||
staff?
|
||||
end
|
||||
|
||||
def unhide?
|
||||
def update?
|
||||
staff?
|
||||
end
|
||||
end
|
||||
|
Reference in New Issue
Block a user