本文整理汇总了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);
}
示例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);
}