public class AddUsersPermissionTask extends NodeVisitorTask
Modifier and Type | Field and Description |
---|---|
static String |
USER_PATH_REPLACEMENT |
DO_NOTHING
Constructor and Description |
---|
AddUsersPermissionTask(String taskName,
String pathToUsers,
String workspace,
String workspacePath,
long permission) |
Modifier and Type | Method and Description |
---|---|
AddUsersPermissionTask |
exclude(String... excludedUserNames) |
protected boolean |
nodeMatches(javax.jcr.Node node)
Implement this method to define which nodes should subsequently be operated upon.
|
protected void |
operateOnNode(InstallContext installContext,
javax.jcr.Node user)
Implement this method to apply changes to each of the nodes that are matched by
NodeVisitorTask.nodeMatches(Node) . |
doExecute, getFilteringPredicate
execute
getDescription, getName, toString
public static final String USER_PATH_REPLACEMENT
public AddUsersPermissionTask(String taskName, String pathToUsers, String workspace, String workspacePath, long permission)
pathToUsers
- path pointing to subtree (or a single user) in users workspaceworkspace
- workspace to add permission forworkspacePath
- path in workspace to add permission for, string ${USER_PATH} will be replaced with path to user to whom is the permission addedpermission
- permission value, see Permission
public AddUsersPermissionTask exclude(String... excludedUserNames)
protected boolean nodeMatches(javax.jcr.Node node)
NodeVisitorTask
This will be called for every visited node in that task, and serves a similar purpose as a JCR query statement.
nodeMatches
in class NodeVisitorTask
node
- the JCR node that is currently being visitedtrue
if the node should be operated upon, false
otherwiseNodeVisitorTask.operateOnNode(InstallContext, Node)
protected void operateOnNode(InstallContext installContext, javax.jcr.Node user)
NodeVisitorTask
NodeVisitorTask.nodeMatches(Node)
.
This is typically where the update logic goes, in a similar fashion as the QueryTask
.
operateOnNode
in class NodeVisitorTask
installContext
- the current install contextuser
- the JCR node that should be operated uponQueryTask.operateOnNode(InstallContext, Node)
Copyright © 2003–2016 Magnolia International Ltd.. All rights reserved.