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


Java Permission.addPermission方法代码示例

本文整理汇总了Java中azkaban.user.Permission.addPermission方法的典型用法代码示例。如果您正苦于以下问题:Java Permission.addPermission方法的具体用法?Java Permission.addPermission怎么用?Java Permission.addPermission使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在azkaban.user.Permission的用法示例。


在下文中一共展示了Permission.addPermission方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: testSinglePermissionCreation

import azkaban.user.Permission; //导入方法依赖的package包/类
@Test
public void testSinglePermissionCreation() throws Exception {
	Permission perm1 = new Permission();
	perm1.addPermissionsByName("READ");
	
	Permission perm2 = new Permission();
	perm2.addPermission(Type.READ);
	info("Compare " + perm1.toString() + " and " + perm2.toString());
	assertTrue(perm1.equals(perm2));
}
 
开发者ID:zhizhounq,项目名称:azkaban-customization,代码行数:11,代码来源:PermissionTest.java

示例2: testListPermissionCreation

import azkaban.user.Permission; //导入方法依赖的package包/类
@Test
public void testListPermissionCreation() throws Exception {
	Permission perm1 = new Permission();
	perm1.addPermissionsByName(new String[]{"READ", "EXECUTE"});
	
	Permission perm2 = new Permission();
	perm2.addPermission(new Type[]{Type.EXECUTE, Type.READ});
	info("Compare " + perm1.toString() + " and " + perm2.toString());
	assertTrue(perm1.equals(perm2));
}
 
开发者ID:zhizhounq,项目名称:azkaban-customization,代码行数:11,代码来源:PermissionTest.java

示例3: testRemovePermission

import azkaban.user.Permission; //导入方法依赖的package包/类
@Test
public void testRemovePermission() throws Exception {
	Permission perm1 = new Permission();
	perm1.addPermissionsByName(new String[]{"READ", "EXECUTE", "WRITE"});
	perm1.removePermissions(Type.EXECUTE);
	
	Permission perm2 = new Permission();
	perm2.addPermission(new Type[]{Type.READ, Type.WRITE});
	info("Compare " + perm1.toString() + " and " + perm2.toString());
	assertTrue(perm1.equals(perm2));
}
 
开发者ID:zhizhounq,项目名称:azkaban-customization,代码行数:12,代码来源:PermissionTest.java

示例4: testRemovePermissionByName

import azkaban.user.Permission; //导入方法依赖的package包/类
@Test
public void testRemovePermissionByName() throws Exception {
	Permission perm1 = new Permission();
	perm1.addPermissionsByName(new String[]{"READ", "EXECUTE", "WRITE"});
	perm1.removePermissionsByName("EXECUTE");
	
	Permission perm2 = new Permission();
	perm2.addPermission(new Type[]{Type.READ, Type.WRITE});
	info("Compare " + perm1.toString() + " and " + perm2.toString());
	assertTrue(perm1.equals(perm2));
}
 
开发者ID:zhizhounq,项目名称:azkaban-customization,代码行数:12,代码来源:PermissionTest.java

示例5: testFlags

import azkaban.user.Permission; //导入方法依赖的package包/类
@Test
public void testFlags() throws Exception {
	Permission permission = new Permission();
	permission.addPermission(new Type[]{Type.READ, Type.WRITE});
	
	int flags = permission.toFlags();
	Permission permission2 = new Permission(flags);
	
	assertTrue(permission2.isPermissionSet(Type.READ));
	assertTrue(permission2.isPermissionSet(Type.WRITE));
	
	assertTrue(permission.equals(permission2));
}
 
开发者ID:zhizhounq,项目名称:azkaban-customization,代码行数:14,代码来源:PermissionTest.java


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