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


Java AccessPermissionImpl类代码示例

本文整理汇总了Java中org.alfresco.repo.security.permissions.impl.AccessPermissionImpl的典型用法代码示例。如果您正苦于以下问题:Java AccessPermissionImpl类的具体用法?Java AccessPermissionImpl怎么用?Java AccessPermissionImpl使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


AccessPermissionImpl类属于org.alfresco.repo.security.permissions.impl包,在下文中一共展示了AccessPermissionImpl类的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: checkTestAuthoritiesPresence

import org.alfresco.repo.security.permissions.impl.AccessPermissionImpl; //导入依赖的package包/类
private void checkTestAuthoritiesPresence(final String[] uniqueGroupNames, final String userName, final boolean shouldPresent)
{
    String tenantDomain = tenantService.getUserDomain(userName);
    
    // Check that created permissions are not visible to tenant 2
    TenantUtil.runAsUserTenant(new TenantRunAsWork<Object>()
    {
        public Object doWork() throws Exception
        {
            NodeRef personNodeRef = personService.getPerson(userName);
            NodeRef homeSpaceRef = (NodeRef)nodeService.getProperty(personNodeRef, ContentModel.PROP_HOMEFOLDER);
            Set<AccessPermission> perms = permissionService.getAllSetPermissions(homeSpaceRef);
            Set<String> auths = authorityService.getAllAuthorities(AuthorityType.GROUP);
            
            for (int i = 0; i < uniqueGroupNames.length; i++)
            {
                AccessPermission toCheck = new AccessPermissionImpl("Consumer", AccessStatus.ALLOWED, "GROUP_" + uniqueGroupNames[i], 0);
                if (shouldPresent)
                {
                    assertTrue(auths.contains("GROUP_" + uniqueGroupNames[i]));
                    assertTrue(perms.contains(toCheck));
                }
                else
                {
                    assertTrue(!auths.contains("GROUP_" + uniqueGroupNames[i]));
                    assertTrue(!perms.contains(toCheck));
                }
            }
            
            return null;
        }
    }, userName, tenantDomain);
}
 
开发者ID:Alfresco,项目名称:alfresco-repository,代码行数:34,代码来源:MultiTDemoTest.java

示例2: setupPermissions

import org.alfresco.repo.security.permissions.impl.AccessPermissionImpl; //导入依赖的package包/类
/**
 * Helper method to setup permissions on mock objects
 */
private void setupPermissions(NodeRef nodeRef)
{
    Set<AccessPermission> perms = new HashSet<AccessPermission>(4);
    
    // setup basic file and read for authorities
    perms.add(new AccessPermissionImpl(RMPermissionModel.READ_RECORDS, AccessStatus.ALLOWED, AUTHORITY, 0));
    perms.add(new AccessPermissionImpl(RMPermissionModel.FILING, AccessStatus.ALLOWED, AUTHORITY2, 1));
    
    // setup in-place readers and writers
    perms.add(new AccessPermissionImpl(RMPermissionModel.READ_RECORDS, AccessStatus.ALLOWED, ExtendedReaderDynamicAuthority.EXTENDED_READER, 2));
    perms.add(new AccessPermissionImpl(RMPermissionModel.FILING, AccessStatus.ALLOWED, ExtendedWriterDynamicAuthority.EXTENDED_WRITER, 3));

    doReturn(perms).when(mockedPermissionService).getAllSetPermissions(nodeRef);
}
 
开发者ID:Alfresco,项目名称:records-management-old,代码行数:18,代码来源:FilePlanPermissionServiceImplUnitTest.java


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