Class: Federails::FollowingPolicy

Inherits:
ApplicationPolicy
  • Object
show all
Defined in:
app/policies/federails/following_policy.rb

Defined Under Namespace

Classes: Scope

Instance Method Summary collapse

Instance Method Details

#create? ⇒ Boolean

Returns:

  • (Boolean)


2
3
4
5
6
7
8
9
10
# File 'app/policies/federails/following_policy.rb', line 2

def create?
  all_of(
    one_of(
      SiteSettings.multiuser_enabled?,
      SiteSettings.federation_enabled?
    ),
    @user
  )
end

#destroy? ⇒ Boolean

Returns:

  • (Boolean)


12
13
14
# File 'app/policies/federails/following_policy.rb', line 12

def destroy?
  create?
end