use of jetbrains.buildServer.server.graphql.model.ProjectPermissions in project teamcity-rest by JetBrains.
the class ProjectResolver method permissions.
@NotNull
public ProjectPermissions permissions(@NotNull Project source, @NotNull DataFetchingEnvironment env) {
GraphQLContext ctx = env.getContext();
SUser user = ctx.getUser();
if (user == null) {
return new ProjectPermissions(false);
}
SProject self = source.getRealProject();
return new ProjectPermissions(AuthUtil.hasPermissionToManageAgentPoolsWithProject(user, self.getProjectId()));
}
Aggregations