本文整理汇总了Java中azkaban.user.Permission.isPermissionSet方法的典型用法代码示例。如果您正苦于以下问题:Java Permission.isPermissionSet方法的具体用法?Java Permission.isPermissionSet怎么用?Java Permission.isPermissionSet使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类azkaban.user.Permission
的用法示例。
在下文中一共展示了Permission.isPermissionSet方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getUserProjectsByRegex
import azkaban.user.Permission; //导入方法依赖的package包/类
public List<Project> getUserProjectsByRegex(User user, String regexPattern) {
List<Project> array = new ArrayList<Project>();
Pattern pattern;
try {
pattern = Pattern.compile(regexPattern, Pattern.CASE_INSENSITIVE);
} catch (PatternSyntaxException e) {
logger.error("Bad regex pattern " + regexPattern);
return array;
}
for (Project project : projectsById.values()) {
Permission perm = project.getUserPermission(user);
if (perm != null
&& (perm.isPermissionSet(Type.ADMIN) || perm
.isPermissionSet(Type.READ))) {
if (pattern.matcher(project.getName()).find()) {
array.add(project);
}
}
}
return array;
}
示例2: getUserProjectsByRegex
import azkaban.user.Permission; //导入方法依赖的package包/类
public List<Project> getUserProjectsByRegex(User user, String regexPattern) {
List<Project> array = new ArrayList<Project>();
Pattern pattern;
try {
pattern = Pattern.compile(regexPattern, Pattern.CASE_INSENSITIVE);
} catch (PatternSyntaxException e) {
logger.error("Bad regex pattern " + regexPattern);
return array;
}
for (Project project : projectsById.values()) {
Permission perm = project.getUserPermission(user);
if (perm != null && (perm.isPermissionSet(Type.ADMIN) || perm.isPermissionSet(Type.READ))) {
if(pattern.matcher(project.getName()).find() ) {
array.add(project);
}
}
}
return array;
}
示例3: hasPermissionToCreateProject
import azkaban.user.Permission; //导入方法依赖的package包/类
private boolean hasPermissionToCreateProject(User user) {
for (String roleName : user.getRoles()) {
Role role = userManager.getRole(roleName);
Permission perm = role.getPermission();
if (perm.isPermissionSet(Permission.Type.ADMIN)
|| perm.isPermissionSet(Permission.Type.CREATEPROJECTS)) {
return true;
}
}
return false;
}
示例4: hasPermissionToCreateProject
import azkaban.user.Permission; //导入方法依赖的package包/类
private boolean hasPermissionToCreateProject(User user) {
for (String roleName : user.getRoles()) {
Role role = userManager.getRole(roleName);
Permission perm = role.getPermission();
if (perm.isPermissionSet(Permission.Type.ADMIN)
|| perm.isPermissionSet(Permission.Type.CREATEPROJECTS)) {
return true;
}
}
return false;
}
示例5: getUserProjects
import azkaban.user.Permission; //导入方法依赖的package包/类
public List<Project> getUserProjects(User user) {
ArrayList<Project> array = new ArrayList<Project>();
for (Project project : projectsById.values()) {
Permission perm = project.getUserPermission(user);
if (perm != null
&& (perm.isPermissionSet(Type.ADMIN) || perm
.isPermissionSet(Type.READ))) {
array.add(project);
}
}
return array;
}
示例6: hasPermission
import azkaban.user.Permission; //导入方法依赖的package包/类
public boolean hasPermission(User user, Type type) {
Permission perm = userPermissionMap.get(user.getUserId());
if (perm != null
&& (perm.isPermissionSet(Type.ADMIN) || perm.isPermissionSet(type))) {
return true;
}
return hasGroupPermission(user, type);
}
示例7: hasUserPermission
import azkaban.user.Permission; //导入方法依赖的package包/类
public boolean hasUserPermission(User user, Type type) {
Permission perm = userPermissionMap.get(user.getUserId());
if (perm == null) {
// Check group
return false;
}
if (perm.isPermissionSet(Type.ADMIN) || perm.isPermissionSet(type)) {
return true;
}
return false;
}
示例8: hasGroupPermission
import azkaban.user.Permission; //导入方法依赖的package包/类
public boolean hasGroupPermission(User user, Type type) {
for (String group : user.getGroups()) {
Permission perm = groupPermissionMap.get(group);
if (perm != null) {
if (perm.isPermissionSet(Type.ADMIN) || perm.isPermissionSet(type)) {
return true;
}
}
}
return false;
}
示例9: getUsersWithPermission
import azkaban.user.Permission; //导入方法依赖的package包/类
public List<String> getUsersWithPermission(Type type) {
ArrayList<String> users = new ArrayList<String>();
for (Map.Entry<String, Permission> entry : userPermissionMap.entrySet()) {
Permission perm = entry.getValue();
if (perm.isPermissionSet(type)) {
users.add(entry.getKey());
}
}
return users;
}
示例10: getUserProjects
import azkaban.user.Permission; //导入方法依赖的package包/类
public List<Project> getUserProjects(User user) {
ArrayList<Project> array = new ArrayList<Project>();
for (Project project : projectsById.values()) {
Permission perm = project.getUserPermission(user);
if (perm != null && (perm.isPermissionSet(Type.ADMIN) || perm.isPermissionSet(Type.READ))) {
array.add(project);
}
}
return array;
}
示例11: hasPermission
import azkaban.user.Permission; //导入方法依赖的package包/类
public boolean hasPermission(User user, Type type) {
Permission perm = userPermissionMap.get(user.getUserId());
if (perm != null && (perm.isPermissionSet(Type.ADMIN) || perm.isPermissionSet(type))) {
return true;
}
return hasGroupPermission(user, type);
}
示例12: hasUserPermission
import azkaban.user.Permission; //导入方法依赖的package包/类
public boolean hasUserPermission(User user, Type type) {
Permission perm = userPermissionMap.get(user.getUserId());
if (perm == null) {
// Check group
return false;
}
if (perm.isPermissionSet(Type.ADMIN) || perm.isPermissionSet(type)) {
return true;
}
return false;
}
示例13: hasGroupPermission
import azkaban.user.Permission; //导入方法依赖的package包/类
public boolean hasGroupPermission(User user, Type type) {
for(String group: user.getGroups()) {
Permission perm = groupPermissionMap.get(group);
if (perm != null) {
if (perm.isPermissionSet(Type.ADMIN) || perm.isPermissionSet(type)) {
return true;
}
}
}
return false;
}
示例14: getUsersWithPermission
import azkaban.user.Permission; //导入方法依赖的package包/类
public List<String> getUsersWithPermission(Type type) {
ArrayList<String> users = new ArrayList<String>();
for (Map.Entry<String, Permission> entry : userPermissionMap.entrySet()) {
Permission perm = entry.getValue();
if (perm.isPermissionSet(type)) {
users.add(entry.getKey());
}
}
return users;
}
示例15: hasPermissionToCreateProject
import azkaban.user.Permission; //导入方法依赖的package包/类
private boolean hasPermissionToCreateProject(User user) {
for(String roleName: user.getRoles()) {
Role role = userManager.getRole(roleName);
Permission perm = role.getPermission();
if (perm.isPermissionSet(Permission.Type.ADMIN) || perm.isPermissionSet(Permission.Type.CREATEPROJECTS)) {
return true;
}
}
return false;
}