Class: CanTango::Permits::RolePermit::Builder
- Inherits:
-
CanTango::PermitEngine::Builder::Base
- Object
- CanTango::PermitEngine::Builder::Base
- CanTango::Permits::RolePermit::Builder
- Defined in:
- lib/cantango/permits/role_permit/builder.rb
Instance Attribute Summary
Attributes inherited from CanTango::PermitEngine::Builder::Base
Instance Method Summary collapse
-
#build ⇒ Array<RoleGroupPermit::Base>
builds a list of Permits for each role of the current ability user (or account).
Methods inherited from CanTango::PermitEngine::Builder::Base
Constructor Details
This class inherits a constructor from CanTango::PermitEngine::Builder::Base
Instance Method Details
#build ⇒ Array<RoleGroupPermit::Base>
builds a list of Permits for each role of the current ability user (or account)
7 8 9 10 11 12 |
# File 'lib/cantango/permits/role_permit/builder.rb', line 7 def build roles.inject([]) do |permits, role| (permits << create_permit(role)) if valid?(role.to_sym) permits end.compact end |