Module: TroleGroups::Api::Write::ClassMethods
- Defined in:
- lib/trole_groups/api/write.rb
Instance Method Summary collapse
-
#set_valid_rolegroups(*rolegroups) ⇒ Object
Sets which rolegroups are valid for the rolegroup subject class (fx User or UserAccount).
Instance Method Details
#set_valid_rolegroups(*rolegroups) ⇒ Object
Note:
this in effect limits what rolegroups can be assigned to any instance of the class
Sets which rolegroups are valid for the rolegroup subject class (fx User or UserAccount)
53 54 55 56 57 |
# File 'lib/trole_groups/api/write.rb', line 53 def set_valid_rolegroups *rolegroups rolegroups = rolegroups.to_symbols_uniq raise ArgumentError, "Roles must contain Symbols or Strings" if rolegroups.empty? @valid_rolegroups = rolegroups end |