Add additional rules to an User’s permissions. Use this for applying rules calculated dynamically.

Called with the SYSTEM user active, so the plugin will have a consistent view of the store and full permissions. Do not call O.impersonating() when responding to this hook.


Name Type Description
user SecurityPrincipal SecurityPrincipal being queried


Return information by changing these properties of the response object.

Name Type Description
rules LabelStatementsBuilder LabelStatementsBuilder object representing extra rules added by plugin

JavaScript template

P.hook('hUserPermissionRules', function(response, user) {
    // Respond to hook, for example
    // response.rules = ...