Node Access operations:

getNodeACL

Get node ACL.

Example using IContentManager

List<ACLEntry> aclList = contentManager.getNodeACL(nodeId);

Example using Node object

// userId is the current user ID
node = contentManager.getNodeById(nodeId, userId);
List<ACLEntry> aclList = node.getACL();

grantNodeAccessToGroup

Grants group access to a node.

Example using IContentManager

// groupId is the group to grant permission
contentManager.grantNodeAccessToGroup(nodeId, groupId);

Example using Node object

// userId is the current user ID
node = contentManager.getNodeById(nodeId, userId);
// groupId is the group to grant permission
node.grantAccessGroup(groupId);

grantNodeAccessToUser

Grants user access to a node.

Example using IContentManager

// userId is the user to grant permission
contentManager.grantNodeAccessToUser(nodeId, userId);

Example using Node object

// userId is the current user ID
node = contentManager.getNodeById(nodeId, userId);
// userAccessId is the user to grant permission
node.grantAccessUser(userAccessId);

hasNodeAccessGroup

Checks if group has access to the node.

// groupId is the group we are checking access
boolean hasAccess = contentManager.hasNodeAccessGroup(nodeId, groupId)

hasNodeAccessUser

Checks if user has access to the node.

// userId is the user we are checking access
boolean hasAccess = contentManager.hasNodeAccessUser(nodeId, userId)

revokeNodeAccessToGroup

Revokes group access to a node.

Example using IContentManager

// groupId is the group to revoke permission
contentManager.revokeNodeAccessToGroup(nodeId, groupId);

Example using Node object

// userId is the current user ID
node = contentManager.getNodeById(nodeId, userId);
// groupId is the group to revoke permission
node.revokeAccessUser(groupId);

revokeNodeAccessToUser

Revokes user access to a node.

Example using IContentManager

// userId is the user to revoke permission
contentManager.revokeNodeAccessToUser(nodeId, userId);

Example using Node object

// userId is the current user ID
node = contentManager.getNodeById(nodeId, userId);
// userAccessId is the user to revoke permission
node.revokeAccessUser(userAccessId);

Back to CMS User Guide.