hUserAttributeRestrictionLabels
This hook allows plugins to specify the restrictions labels for a given user to lift restrictions.
There should generally only be one plugin using this hook, as part of a pluggable permission system.
P.hook("hUserAttributeRestrictionLabels", function(response, user) {
if(user.isMemberOf(Group.RepositoryEditors)) {
response.userLabels.add(Label.LiftAllEmbargoRestrictions);
}
});
Arguments
| Name | Type | Description |
user |
SecurityPrincipal |
SecurityPrincipal being queried |
Response
Return information by changing these properties of the response object.
| Name | Type | Description |
labels |
LabelList |
DEPRECATED (will be removed in later version): Labels enabling the user to view or edit restricted attributes |
userLabels |
LabelChanges |
Labels enabling the user to view or edit restricted attributes, specified as changes from the empty label list. |
JavaScript template
P.hook('hUserAttributeRestrictionLabels', function(response, user) {
// Respond to hook, for example
// response.labels = ...
});