Module: Platform::SimpleStringPermissions
- Included in:
- Application
- Defined in:
- lib/platform/simple_string_permissions.rb
Instance Method Summary collapse
Instance Method Details
#has_permission?(key) ⇒ Boolean
35 36 37 |
# File 'lib/platform/simple_string_permissions.rb', line 35 def (key) .to_s.split(',').include?(key.to_s) end |
#set_permission(key, value) ⇒ Object
27 28 29 30 31 32 33 |
# File 'lib/platform/simple_string_permissions.rb', line 27 def (key, value) self. = if value (.to_s.split(',').to_set + key.to_s) else (.to_s.split(',').to_set - key.to_s) end.join(',') end |