本文整理汇总了Java中org.alfresco.service.cmr.security.PermissionService.WRITE属性的典型用法代码示例。如果您正苦于以下问题:Java PermissionService.WRITE属性的具体用法?Java PermissionService.WRITE怎么用?Java PermissionService.WRITE使用的例子?那么, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在类org.alfresco.service.cmr.security.PermissionService
的用法示例。
在下文中一共展示了PermissionService.WRITE属性的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getSetPermission
/**
* @param permission String
* @return permission to set
*/
public String getSetPermission(String permission)
{
if (permission.equals(CMIS_READ))
{
return PermissionService.READ;
} else if (permission.equals(CMIS_WRITE))
{
return PermissionService.WRITE;
} else if (permission.equals(CMIS_ALL))
{
return PermissionService.ALL_PERMISSIONS;
} else
{
return permission;
}
}
示例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);
}