Class: AnotherApi::ApiTokenScopedPolicy

Inherits:
ActionPolicy::Base
  • Object
show all
Defined in:
lib/another_api/api_token_scoped_policy.rb

Direct Known Subclasses

ApiTokenOwnershipPolicy

Instance Method Summary collapse

Instance Method Details

#create?Boolean

Returns:

  • (Boolean)


12
# File 'lib/another_api/api_token_scoped_policy.rb', line 12

def create? = allows?(scope_for_action(:create))

#destroy?Boolean

Returns:

  • (Boolean)


14
# File 'lib/another_api/api_token_scoped_policy.rb', line 14

def destroy? = allows?(scope_for_action(:delete))

#fallback?Boolean

Returns:

  • (Boolean)


15
# File 'lib/another_api/api_token_scoped_policy.rb', line 15

def fallback? = false

#index?Boolean

Returns:

  • (Boolean)


10
# File 'lib/another_api/api_token_scoped_policy.rb', line 10

def index? = allows?(scope_for_action(:list))

#manage?Boolean

Returns:

  • (Boolean)


16
# File 'lib/another_api/api_token_scoped_policy.rb', line 16

def manage? = false

#show?Boolean

Returns:

  • (Boolean)


11
# File 'lib/another_api/api_token_scoped_policy.rb', line 11

def show? = allows?(scope_for_action(:show))

#update?Boolean

Returns:

  • (Boolean)


13
# File 'lib/another_api/api_token_scoped_policy.rb', line 13

def update? = allows?(scope_for_action(:update))