本文整理汇总了Java中org.alfresco.service.cmr.security.PermissionService.DELETE_NODE属性的典型用法代码示例。如果您正苦于以下问题:Java PermissionService.DELETE_NODE属性的具体用法?Java PermissionService.DELETE_NODE怎么用?Java PermissionService.DELETE_NODE使用的例子?那么, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在类org.alfresco.service.cmr.security.PermissionService
的用法示例。
在下文中一共展示了PermissionService.DELETE_NODE属性的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: CanDeleteDocumentEvaluator
/**
* Construct
*
* @param serviceRegistry ServiceRegistry
*/
protected CanDeleteDocumentEvaluator(ServiceRegistry serviceRegistry)
{
super(serviceRegistry, Action.CAN_DELETE_OBJECT);
this.currentVersionEvaluator = new PermissionActionEvaluator(serviceRegistry,
Action.CAN_DELETE_OBJECT, PermissionService.DELETE_NODE);
}
示例2: testReadonlyNodeHasPermission
@Test
public void testReadonlyNodeHasPermission() throws Exception
{
// virtual permission should override actual permissions
NodeRef aVFTestTemplate2 = createVirtualizedFolder(testRootFolder.getNodeRef(),
"aVFTestTemplate2",
TEST_TEMPLATE_2_JSON_SYS_PATH);
NodeRef vf2Node2 = nodeService.getChildByName(aVFTestTemplate2,
ContentModel.ASSOC_CONTAINS,
"Node2");
final String[] deniedReadOnly = new String[] { PermissionService.UNLOCK, PermissionService.CANCEL_CHECK_OUT,
PermissionService.CHANGE_PERMISSIONS, PermissionService.CREATE_CHILDREN, PermissionService.DELETE,
PermissionService.WRITE, PermissionService.DELETE_NODE, PermissionService.WRITE_PROPERTIES,
PermissionService.WRITE_CONTENT, PermissionService.CREATE_ASSOCIATIONS };
StringBuilder nonDeniedTrace = new StringBuilder();
for (int i = 0; i < deniedReadOnly.length; i++)
{
AccessStatus accessStatus = hasPermissionAs(vf2Node2,
deniedReadOnly[i],
user1);
if (!AccessStatus.DENIED.equals(accessStatus))
{
if (nonDeniedTrace.length() > 0)
{
nonDeniedTrace.append(",");
}
nonDeniedTrace.append(deniedReadOnly[i]);
}
}
assertTrue("Non-denied permissions on RO virtual nodes : " + nonDeniedTrace,
nonDeniedTrace.length() == 0);
}
示例3: setFlag
private void setFlag(NodeRef nodeRef, Flag flag, boolean value)
{
String permission = (flag == Flag.DELETED ? PermissionService.DELETE_NODE : PermissionService.WRITE_PROPERTIES);
AccessStatus status = permissionService.hasPermission(nodeRef, permission);
if (status == AccessStatus.DENIED)
{
if(flag == Flag.DELETED)
{
logger.debug("[setFlag] Access denied to set DELETED FLAG:" + nodeRef);
throw new AccessDeniedException("No permission to set DELETED flag");
}
if(flag == Flag.SEEN)
{
logger.debug("[setFlag] Access denied to set SEEN FLAG:" + nodeRef);
//TODO - should we throw an exception here?
//throw new AccessDeniedException("No permission to set DELETED flag");
}
else
{
logger.debug("[setFlag] Access denied to set flag:" + nodeRef);
throw new AccessDeniedException("No permission to set flag:" + flag.toString());
}
}
else
{
checkForFlaggableAspect(nodeRef);
policyBehaviourFilter.disableBehaviour(ContentModel.ASPECT_AUDITABLE);
policyBehaviourFilter.disableBehaviour(ContentModel.ASPECT_VERSIONABLE);
try
{
if(logger.isDebugEnabled())
{
logger.debug("set flag nodeRef:" + nodeRef + ",flag:" + flagToQname.get(flag) + ", value:" + value);
}
nodeService.setProperty(nodeRef, flagToQname.get(flag), value);
messageCache.remove(nodeRef);
}
finally
{
policyBehaviourFilter.enableBehaviour(ContentModel.ASPECT_AUDITABLE);
policyBehaviourFilter.enableBehaviour(ContentModel.ASPECT_VERSIONABLE);
}
}
}