当前位置: 首页>>代码示例>>Java>>正文


Java PermissionService.WRITE属性代码示例

本文整理汇总了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;
    }
}
 
开发者ID:Alfresco,项目名称:alfresco-data-model,代码行数:20,代码来源:CMISMapping.java

示例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);
}
 
开发者ID:Alfresco,项目名称:alfresco-repository,代码行数:36,代码来源:VirtualPermissionServiceExtensionTest.java


注:本文中的org.alfresco.service.cmr.security.PermissionService.WRITE属性示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。