Policy Engine For Heat.
heat.common.policy.
Enforcer
(scope='heat', exc=<class 'heat.common.exception.Forbidden'>, default_rule=<oslo_policy._checks.FalseCheck object>, policy_file=None)[source]¶Bases: object
Responsible for loading and enforcing rules.
check_is_admin
(context)[source]¶Whether or not is admin according to policy.
By default the rule will check whether or not roles contains ‘admin’ role and is admin project.
param context: Heat request context returns: A non-False value if the user is admin according to policy
enforce
(context, action, scope=None, target=None, is_registered_policy=False)[source]¶Verifies that the action is valid on the target in this context.
Parameters: |
|
---|---|
Raises: | heat.common.exception.Forbidden – When permission is denied (or self.exc if supplied). |
Returns: | A non-False value if access is allowed. |
heat.common.policy.
ResourceEnforcer
(default_rule=<oslo_policy._checks.TrueCheck object>, **kwargs)[source]¶Bases: heat.common.policy.Enforcer
enforce
(context, res_type, scope=None, target=None, is_registered_policy=False)[source]¶Verifies that the action is valid on the target in this context.
Parameters: |
|
---|---|
Raises: | heat.common.exception.Forbidden – When permission is denied (or self.exc if supplied). |
Returns: | A non-False value if access is allowed. |
Except where otherwise noted, this document is licensed under Creative Commons Attribution 3.0 License. See all OpenStack Legal Documents.