本文整理汇总了Java中azkaban.project.Project.getGroupPermissions方法的典型用法代码示例。如果您正苦于以下问题:Java Project.getGroupPermissions方法的具体用法?Java Project.getGroupPermissions怎么用?Java Project.getGroupPermissions使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类azkaban.project.Project
的用法示例。
在下文中一共展示了Project.getGroupPermissions方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: toSimplifiedProjects
import azkaban.project.Project; //导入方法依赖的package包/类
/**
* A simple helper method that converts a List<Project> to List<SimplifiedProject>
*
* @param projects
* @return
*/
private List<SimplifiedProject> toSimplifiedProjects(List<Project> projects) {
List<SimplifiedProject> simplifiedProjects = new ArrayList<>();
for (Project p : projects) {
SimplifiedProject sp =
new SimplifiedProject(p.getId(), p.getName(),
p.getLastModifiedUser(), p.getCreateTimestamp(),
p.getUserPermissions(), p.getGroupPermissions());
simplifiedProjects.add(sp);
}
return simplifiedProjects;
}
示例2: handlePermissionPage
import azkaban.project.Project; //导入方法依赖的package包/类
private void handlePermissionPage(HttpServletRequest req, HttpServletResponse resp, Session session) throws ServletException {
Page page = newPage(req, resp, session, "azkaban/webapp/servlet/velocity/permissionspage.vm");
String projectName = getParam(req, "project");
User user = session.getUser();
Project project = null;
try {
project = projectManager.getProject(projectName);
if (project == null) {
page.add("errorMsg", "Project " + projectName + " not found.");
}
else {
if (!hasPermission(project, user, Type.READ)) {
throw new AccessControlException( "No permission to view project " + projectName + ".");
}
page.add("project", project);
page.add("username", user.getUserId());
page.add("admins", Utils.flattenToString(project.getUsersWithPermission(Type.ADMIN), ","));
Permission perm = this.getPermissionObject(project, user, Type.ADMIN);
page.add("userpermission", perm);
if (perm.isPermissionSet(Type.ADMIN)) {
page.add("admin", true);
}
List<Pair<String, Permission>> userPermission = project.getUserPermissions();
if (userPermission != null && !userPermission.isEmpty()) {
page.add("permissions", userPermission);
}
List<Pair<String, Permission>> groupPermission = project.getGroupPermissions();
if (groupPermission != null && !groupPermission.isEmpty()) {
page.add("groupPermissions", groupPermission);
}
Set<String> proxyUsers = project.getProxyUsers();
if (proxyUsers != null && !proxyUsers.isEmpty()) {
page.add("proxyUsers", proxyUsers);
}
if(hasPermission(project, user, Type.ADMIN)) {
page.add("isAdmin", true);
}
}
}
catch(AccessControlException e) {
page.add("errorMsg", e.getMessage());
}
page.render();
}