diff --git a/doc/source/topics/policy.rst b/doc/source/topics/policy.rst index 2c67054b5..9a9c67625 100644 --- a/doc/source/topics/policy.rst +++ b/doc/source/topics/policy.rst @@ -145,6 +145,18 @@ An Example looks like:: policy.ifAllowed({ rules: rules }).then(policySuccess, policyFailed); } +The fourth way to add a role based check is in html files. Use angular directive 'hz-if-policies' +in file 'openstack_dashboard.static.app.core.cloud-services.hz-if-policies-directive.js'. +Assume you have the following policy defined in your angular controller:: + + ctrl.policy = { rules: [["identity", "identity:update_user"]] } + +Then in your HTML, use it like so:: + +
+ I am visible if the policy is allowed! +
+ .. _rule_targets: Rule Targets