Commiting
This commit is contained in:
@@ -1,19 +0,0 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
class DomainBlockPolicy < ApplicationPolicy
|
||||
def index?
|
||||
admin?
|
||||
end
|
||||
|
||||
def show?
|
||||
admin?
|
||||
end
|
||||
|
||||
def create?
|
||||
admin?
|
||||
end
|
||||
|
||||
def destroy?
|
||||
admin?
|
||||
end
|
||||
end
|
||||
@@ -1,11 +0,0 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
class InstancePolicy < ApplicationPolicy
|
||||
def index?
|
||||
admin?
|
||||
end
|
||||
|
||||
def show?
|
||||
admin?
|
||||
end
|
||||
end
|
||||
@@ -1,29 +0,0 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
class InvitePolicy < ApplicationPolicy
|
||||
def index?
|
||||
staff?
|
||||
end
|
||||
|
||||
def create?
|
||||
min_required_role?
|
||||
end
|
||||
|
||||
def deactivate_all?
|
||||
admin?
|
||||
end
|
||||
|
||||
def destroy?
|
||||
owner? || (Setting.min_invite_role == 'admin' ? admin? : staff?)
|
||||
end
|
||||
|
||||
private
|
||||
|
||||
def owner?
|
||||
record.user_id == current_user&.id
|
||||
end
|
||||
|
||||
def min_required_role?
|
||||
current_user&.role?(Setting.min_invite_role)
|
||||
end
|
||||
end
|
||||
@@ -1,7 +0,0 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
class RelayPolicy < ApplicationPolicy
|
||||
def update?
|
||||
admin?
|
||||
end
|
||||
end
|
||||
@@ -42,7 +42,7 @@ class StatusPolicy < ApplicationPolicy
|
||||
private
|
||||
|
||||
def requires_mention?
|
||||
record.direct_visibility? || record.limited_visibility?
|
||||
record.limited_visibility?
|
||||
end
|
||||
|
||||
def owned?
|
||||
|
||||
@@ -1,7 +0,0 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
class SubscriptionPolicy < ApplicationPolicy
|
||||
def index?
|
||||
admin?
|
||||
end
|
||||
end
|
||||
Reference in New Issue
Block a user