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


Java Permission.isPermissionSet方法代码示例

本文整理汇总了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;
}
 
开发者ID:JasonBian,项目名称:azkaban,代码行数:24,代码来源:ProjectManager.java

示例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;
}
 
开发者ID:zhizhounq,项目名称:azkaban-customization,代码行数:23,代码来源:ProjectManager.java

示例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;
}
 
开发者ID:JasonBian,项目名称:azkaban,代码行数:13,代码来源:ProjectManagerServlet.java

示例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;
}
 
开发者ID:JasonBian,项目名称:azkaban,代码行数:13,代码来源:ProjectServlet.java

示例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;
}
 
开发者ID:JasonBian,项目名称:azkaban,代码行数:14,代码来源:ProjectManager.java

示例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);
}
 
开发者ID:JasonBian,项目名称:azkaban,代码行数:10,代码来源:Project.java

示例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;
}
 
开发者ID:JasonBian,项目名称:azkaban,代码行数:14,代码来源:Project.java

示例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;
}
 
开发者ID:JasonBian,项目名称:azkaban,代码行数:13,代码来源:Project.java

示例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;
}
 
开发者ID:JasonBian,项目名称:azkaban,代码行数:11,代码来源:Project.java

示例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;
}
 
开发者ID:zhizhounq,项目名称:azkaban-customization,代码行数:12,代码来源:ProjectManager.java

示例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);
}
 
开发者ID:zhizhounq,项目名称:azkaban-customization,代码行数:9,代码来源:Project.java

示例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;
}
 
开发者ID:zhizhounq,项目名称:azkaban-customization,代码行数:14,代码来源:Project.java

示例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;
}
 
开发者ID:zhizhounq,项目名称:azkaban-customization,代码行数:13,代码来源:Project.java

示例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;
}
 
开发者ID:zhizhounq,项目名称:azkaban-customization,代码行数:11,代码来源:Project.java

示例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;
}
 
开发者ID:zhizhounq,项目名称:azkaban-customization,代码行数:12,代码来源:ProjectManagerServlet.java


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