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