Module: IAmICan::Permission::Helpers::Ins
- Included in:
- Assignment
- Defined in:
- lib/i_am_i_can/permission/helpers.rb
Instance Method Summary collapse
- #_pms_assignment_result(preds, obj, not_defined_items, covered_items = nil, strict_mode = false) ⇒ Object
- #local_permissions ⇒ Object (also: #local_permission_names)
-
#permissions ⇒ Object
TODO: show by hash.
- #pms_matched?(pms_name, plist) ⇒ Boolean
Instance Method Details
#_pms_assignment_result(preds, obj, not_defined_items, covered_items = nil, strict_mode = false) ⇒ Object
48 49 50 51 52 53 54 55 56 |
# File 'lib/i_am_i_can/permission/helpers.rb', line 48 def _pms_assignment_result(preds, obj, not_defined_items, covered_items = nil, strict_mode = false) prefix = 'Permission Assignment Done' msg1 = "#{not_defined_items} have not been defined or have been repeatedly assigned" if not_defined_items.present? msg2 = "#{covered_items} have been covered" if covered_items.present? fail_msg = prefix + ', but ' + [msg1, msg2].compact.join(', ') if msg1 || msg2 raise Error, fail_msg if (strict_mode || i_am_i_can.strict_mode) && fail_msg puts fail_msg || prefix unless ENV['ITEST'] prefix.present? end |
#local_permissions ⇒ Object Also known as: local_permission_names
62 63 64 |
# File 'lib/i_am_i_can/permission/helpers.rb', line 62 def @local_permissions ||= [ ] end |
#permissions ⇒ Object
TODO: show by hash
69 70 71 |
# File 'lib/i_am_i_can/permission/helpers.rb', line 69 def + end |
#pms_matched?(pms_name, plist) ⇒ Boolean
58 59 60 |
# File 'lib/i_am_i_can/permission/helpers.rb', line 58 def pms_matched?(pms_name, plist) i_am_i_can..matched?(pms_name, in: plist[:in]) end |