Policy Engine For Cinder
Verifies that the action is valid on the target in this context.
| Parameters: |
|
|---|---|
| Raises: | cinder.exception.PolicyNotAuthorized – if verification fails and do_raise is True. Or if ‘exc’ is specified it will raise an exception of that type. |
| Returns: | returns a non-False value (not necessarily “True”) if authorized, and the exact value False if not authorized and do_raise is False. |
check_is_admin(context)¶Whether or not user is admin according to policy setting.
enforce(context, action, target)¶Verifies that the action is valid on the target in this context.
| Parameters: |
|
|---|---|
| Raises: | PolicyNotAuthorized – if verification fails. |
get_enforcer()¶get_rules()¶init(use_conf=True)¶Init an Enforcer class.
| Parameters: | use_conf – Whether to load rules from config file. |
|---|
register_rules(enforcer)¶reset()¶set_rules(rules, overwrite=True, use_conf=False)¶Set rules based on the provided dict of rules.
| Parameters: |
|
|---|
verify_deprecated_policy(old_policy, new_policy, default_rule, context)¶Check the rule of the deprecated policy action
If the current rule of the deprecated policy action is set to a non-default value, then a warning message is logged stating that the new policy action should be used to dictate permissions as the old policy action is being deprecated.
| Parameters: |
|
|---|
Except where otherwise noted, this document is licensed under Creative Commons Attribution 3.0 License. See all OpenStack Legal Documents.