Class: Shamu::Security::NoPolicy

Inherits:
Policy
  • Object
show all
Defined in:
lib/shamu/security/no_policy.rb

Overview

Used in specs and service to service delegated requests to effectively offer no policy and permit all actions.

Instance Attribute Summary

Attributes inherited from Policy

#principal, #related_user_ids, #roles

Instance Method Summary collapse

Methods inherited from Policy

#add_rule, #alias_action, #authorize!, #deny, #dsl_resource, #expand_alias_into, #expand_aliases, #extract_resource, #fail_on_active_record_check, #in_role?, #initialize, #is_principal?, #permissions, #permit, #resource, #when_elevated

Methods included from Roles

expand_roles, role, role_defined?, roles

Constructor Details

This class inherits a constructor from Shamu::Security::Policy

Instance Method Details

#permit?:yes, ...

Determines if the given action may be performed on the given resource.

Parameters:

  • action (Symbol)

    to perform.

  • resource (Object)

    the resource the action will be performed on.

  • additional_context (Object)

    that the policy may consider.

Returns:

  • (:yes, :maybe, false)

    a truthy value if permitted, otherwise false. The truthy value depends on the certainty of the policy. A value of :yes or true indicates the action is always permitted. A value of :maybe indicates the action is permitted but the user may need to present additional credentials such as logging on this session or entering a TFA code.



9
10
11
# File 'lib/shamu/security/no_policy.rb', line 9

def permit?( * )
  :yes
end