Method: Scrivito::UserDefinition#can_always
- Defined in:
- app/cms/scrivito/user_definition.rb
#can_always(verb, subject, message = nil) ⇒ Object
Note:
Usually, the memberships of a workspace decide whether a user is allowed or not to perform a specific action. This method lets you add an exception to this logic and thus should be used carefully.
Note:
By default, all users are allowed to create a new workspace.
Adds an explicit rule that allows the user to always execute an action. A rule consists of an action verb, the subject of the action, and an optional message.
41 42 43 44 |
# File 'app/cms/scrivito/user_definition.rb', line 41 def can_always(verb, subject, = nil) assert_no_conflict(:never, verb, subject) @explicit_rules << [:always, verb, subject, ] end |