• 如果您觉得本站非常有看点,那么赶紧使用Ctrl+D 收藏吧

Java AuthUtil类的典型用法和代码示例

java 2次浏览

本文整理汇总了Java中jetbrains.buildServer.serverSide.auth.AuthUtil的典型用法代码示例。如果您正苦于以下问题:Java AuthUtil类的具体用法?Java AuthUtil怎么用?Java AuthUtil使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。

AuthUtil类属于jetbrains.buildServer.serverSide.auth包,在下文中一共展示了AuthUtil类的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: getReposList

点赞 3

import jetbrains.buildServer.serverSide.auth.AuthUtil; //导入依赖的package包/类
private List<DebRepositoryConfigProjectAndStatsWrapper> getReposList() {
	List<DebRepositoryConfigProjectAndStatsWrapper> configs = new ArrayList<>();
	for (DebRepositoryConfiguration config : myDebRepositoryConfigurationManager.getAllConfigurations()) {
		SProject project = myBuildServer.getProjectManager().findProjectById(config.getProjectId());
		boolean permissioned = AuthUtil.hasPermissionToManageProject(mySecurityContext.getAuthorityHolder(), project.getProjectId());
		configs.add(
				new DebRepositoryConfigProjectAndStatsWrapper(project,
						config, 
						myDebRepositoryManager.getRepositoryStatistics(
					   						config, 
					   						StringUtils.getDebRepoUrl(
					   										myServer.getRootUrl(), 
					   										config.getRepoName(),
					   										config.isRestricted())
					   						), 
						permissioned)
				);
	}
	return configs;
}
 

开发者ID:tcplugins,
项目名称:tcDebRepository,
代码行数:21,
代码来源:DebRepoListingPageController.java

示例2: checkRepoIsRestricted

点赞 2

import jetbrains.buildServer.serverSide.auth.AuthUtil; //导入依赖的package包/类
@Override
protected void checkRepoIsRestricted(String repoName) throws DebRepositoryAccessIsRestrictedException, DebRepositoryPermissionDeniedException, NonExistantRepositoryException {
	if (myDebRepositoryManager.isRestrictedRepository(repoName)) {
		String projectId = myDebRepositoryConfigManager.getDebRepositoryConfigurationByName(repoName).getProjectId();
		if (! AuthUtil.hasReadAccessTo(mySecurityContext.getAuthorityHolder(), projectId)) {
			throw new DebRepositoryPermissionDeniedException();
		}
	}
}
 

开发者ID:tcplugins,
项目名称:tcDebRepository,
代码行数:10,
代码来源:DebDownloadRestrictedAccessController.java

示例3: fillModel

点赞 2

import jetbrains.buildServer.serverSide.auth.AuthUtil; //导入依赖的package包/类
@Override
public void fillModel(@NotNull final Map<String, Object> model, @NotNull final HttpServletRequest request) {
    final SProject currentProject = getProject(request);
    if (currentProject == null) {
        return;
    }
    Map<SProject, List<DebRepositoryConfigAndStatsWrapper>> reposMap = getServersMap(currentProject);
    model.put("repositoriesMap", reposMap);
    model.put("projectId", currentProject.getExternalId());
    model.put("userHasPermissionManagement", AuthUtil.hasPermissionToManageProject(mySecurityContext.getAuthorityHolder(), currentProject.getProjectId()));
}
 

开发者ID:tcplugins,
项目名称:tcDebRepository,
代码行数:12,
代码来源:DebRepoProjectSettingsTab.java

示例4: getPermissionedProjects

点赞 2

import jetbrains.buildServer.serverSide.auth.AuthUtil; //导入依赖的package包/类
private List<SProject> getPermissionedProjects() {
	List<SProject> usersProjects = new ArrayList<>();
	for (SProject p : myBuildServer.getProjectManager().getProjects()) {
		if (AuthUtil.hasPermissionToManageProject(mySecurityContext.getAuthorityHolder(), p.getProjectId())) {
			usersProjects.add(p);
		}
	}
	return usersProjects;
}
 

开发者ID:tcplugins,
项目名称:tcDebRepository,
代码行数:10,
代码来源:DebRepoConfigurationEditPageController.java

示例5: fillModel

点赞 2

import jetbrains.buildServer.serverSide.auth.AuthUtil; //导入依赖的package包/类
@Override
public void fillModel(@NotNull final Map<String, Object> model, @NotNull final HttpServletRequest request) {
    final SProject currentProject = getProject(request);
    if (currentProject == null) {
        return;
    }
    Map<SProject, List<SQSInfo>> infoMap = getServersMap(currentProject);
    model.put("availableServersMap", infoMap);
    model.put("projectId", currentProject.getExternalId());
    model.put("userHasPermissionManagement", AuthUtil.hasPermissionToManageProject(securityContext.getAuthorityHolder(), currentProject.getProjectId()));
}
 

开发者ID:JetBrains,
项目名称:TeamCity.SonarQubePlugin,
代码行数:12,
代码来源:ServerManagementProjectTab.java

示例6: hasAccess

点赞 2

import jetbrains.buildServer.serverSide.auth.AuthUtil; //导入依赖的package包/类
private boolean hasAccess() {
  return AuthUtil.hasGlobalPermission(mySecurityContext.getAuthorityHolder(), Permission.CHANGE_SERVER_SETTINGS);
}
 

开发者ID:JetBrains,
项目名称:teamcity-symbol-server,
代码行数:4,
代码来源:SymbolServerSettingsTab.java

示例7: userHasPermission

点赞 2

import jetbrains.buildServer.serverSide.auth.AuthUtil; //导入依赖的package包/类
private boolean userHasPermission() {
    return AuthUtil.hasGlobalPermission(securityContext.getAuthorityHolder(), Permission.CHANGE_SERVER_SETTINGS);
}
 

开发者ID:automate-website,
项目名称:teamcity-plugin,
代码行数:4,
代码来源:GlobalServerConfigTab.java

示例8: isAvailable

点赞 2

import jetbrains.buildServer.serverSide.auth.AuthUtil; //导入依赖的package包/类
private boolean isAvailable(@NotNull SUser user, @NotNull SProject project) {
  return AuthUtil.isSystemAdmin(user) || AuthUtil.hasPermissionToManageProject(user, project.getProjectId());
}
 

开发者ID:IIIEII,
项目名称:ServerConfigurations,
代码行数:4,
代码来源:Controller.java

示例9: isAvailable

点赞 2

import jetbrains.buildServer.serverSide.auth.AuthUtil; //导入依赖的package包/类
private boolean isAvailable(@NotNull SUser user) {
  return AuthUtil.isSystemAdmin(user) || AuthUtil.hasPermissionToManageAllProjects(user);
}
 

开发者ID:IIIEII,
项目名称:ServerConfigurations,
代码行数:4,
代码来源:Controller.java


版权声明:本文转自网络文章,转载此文章仅为分享知识,如有侵权,请联系管理员进行删除。
喜欢 (0)