Changing behavior when a permission is undefined

henning-koch edited this page Sep 13, 2010 · 2 revisions

By default all permissions are considered defined. user.may_do_something_undefined? returns false instead of raising an error.

You can change this behavior with the missing_action_means directive:

class Permission < Aegis::Permissions
  missing_action_means :error

Possible arguments are:

- :default_permission: Fall back to the role’s default permission (default)
- :error: Raise an error if an undefined permission is queried
- :allow: Always allow undefined permission queries
- :deny: Always deny undefined permission queries