hUserLabelStatements

Allows a plugin to augment or completely rewrite the label statements which represent the permissions of a user.

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

When implementing custom permissions, you must call O.reloadUserPermissions() whenever the underlying information changes.

Arguments

Name Type Description
user SecurityPrincipal SecurityPrincipal being queried

Response

Return information by changing these properties of the response object.

Name Type Description
statements LabelStatements LabelStatements object representing the permissions, which can be replaced by a plugin

JavaScript template


P.hook('hUserLabelStatements', function(response, user) {
    // Respond to hook, for example
    // response.statements = ...
});