Module: Micro::Authorization::Permissions::ForEachFeature

Extended by:
ForEachFeature
Included in:
ForEachFeature
Defined in:
lib/micro/authorization/permissions/for_each_feature.rb

Constant Summary collapse

DOT =
'.'.freeze
ANY =
'any'.freeze
ONLY =
'only'.freeze
EXCEPT =
'except'.freeze

Instance Method Summary collapse

Instance Method Details

#authorize?(role, inside:, to:) ⇒ Boolean

Returns:

  • (Boolean)


13
14
15
# File 'lib/micro/authorization/permissions/for_each_feature.rb', line 13

def authorize?(role, inside:, to:)
  to.all? { |feature| permit?(inside, role[feature]) }
end