Merge from head.

git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/BRANCHES/WCM-DEV2/root@3314 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
Britt Park
2006-07-13 07:06:30 +00:00
parent b601821d98
commit fae76d7896
41 changed files with 1354 additions and 147 deletions

View File

@@ -47,6 +47,7 @@ import org.alfresco.service.cmr.repository.NodeRef;
import org.alfresco.service.cmr.repository.NodeService;
import org.alfresco.service.cmr.repository.TemplateImageResolver;
import org.alfresco.service.cmr.security.AccessStatus;
import org.alfresco.service.cmr.security.PermissionService;
import org.alfresco.service.namespace.NamespaceService;
import org.alfresco.service.namespace.QName;
import org.alfresco.service.namespace.RegexQNamePattern;
@@ -488,6 +489,66 @@ public final class Node implements Serializable
return allowed;
}
/**
* @return true if the node inherits permissions from the parent node, false otherwise
*/
public boolean inheritsPermissions()
{
return this.services.getPermissionService().getInheritParentPermissions(this.nodeRef);
}
/**
* Set whether this node should inherit permissions from the parent node.
*
* @param inherit True to inherit parent permissions, false otherwise.
*/
public void setInheritsPermissions(boolean inherit)
{
this.services.getPermissionService().setInheritParentPermissions(this.nodeRef, inherit);
}
/**
* Apply a permission for ALL users to the node.
*
* @param permission Permission to apply @see org.alfresco.service.cmr.security.PermissionService
*/
public void setPermission(String permission)
{
this.services.getPermissionService().setPermission(this.nodeRef, PermissionService.ALL_AUTHORITIES, permission, true);
}
/**
* Apply a permission for the specified authority (e.g. username or group) to the node.
*
* @param permission Permission to apply @see org.alfresco.service.cmr.security.PermissionService
* @param authority Authority (generally a username or group name) to apply the permission for
*/
public void setPermission(String permission, String authority)
{
this.services.getPermissionService().setPermission(this.nodeRef, authority, permission, true);
}
/**
* Remove a permission for ALL user from the node.
*
* @param permission Permission to remove @see org.alfresco.service.cmr.security.PermissionService
*/
public void removePermission(String permission)
{
this.services.getPermissionService().deletePermission(this.nodeRef, PermissionService.ALL_AUTHORITIES, permission);
}
/**
* Remove a permission for the specified authority (e.g. username or group) from the node.
*
* @param permission Permission to remove @see org.alfresco.service.cmr.security.PermissionService
* @param authority Authority (generally a username or group name) to apply the permission for
*/
public void removePermission(String permission, String authority)
{
this.services.getPermissionService().deletePermission(this.nodeRef, authority, permission);
}
/**
* @return Display path to this node
*/