Class: CanTango::Builder::Permit::Role
- Inherits:
-
Base
- Object
- Base
- CanTango::Builder::Permit::Role
- Includes:
- Helpers::Debug
- Defined in:
- lib/cantango/roles_ext/builder/permit/role.rb
Instance Method Summary collapse
-
#build ⇒ Array<RoleGroupPermit::Base>
builds a list of Permits for each role of the current ability user (or account).
Instance Method Details
#build ⇒ Array<RoleGroupPermit::Base>
builds a list of Permits for each role of the current ability user (or account)
8 9 10 11 12 13 14 15 16 17 18 |
# File 'lib/cantango/roles_ext/builder/permit/role.rb', line 8 def build if roles.empty? debug "Not building any RolePermit" return [] end roles.inject([]) do |permits, role| debug "Building RolePermit for #{role}" (permits << create_permit(role)) if valid?(role.to_sym) permits end.compact end |