Search in sources :

Example 1 with GlobalPermissions

use of jetbrains.buildServer.server.graphql.model.GlobalPermissions in project teamcity-rest by JetBrains.

the class Query method globalPermissions.

@NotNull
public GlobalPermissions globalPermissions(@NotNull DataFetchingEnvironment env) {
    GraphQLContext ctx = env.getContext();
    SUser user = ctx.getUser();
    if (user == null) {
        return new GlobalPermissions(false);
    }
    return new GlobalPermissions(user.getGlobalPermissions().contains(Permission.MANAGE_AGENT_POOLS));
}
Also used : GlobalPermissions(jetbrains.buildServer.server.graphql.model.GlobalPermissions) SUser(jetbrains.buildServer.users.SUser) GraphQLContext(jetbrains.buildServer.server.graphql.GraphQLContext) NotNull(org.jetbrains.annotations.NotNull)

Aggregations

GraphQLContext (jetbrains.buildServer.server.graphql.GraphQLContext)1 GlobalPermissions (jetbrains.buildServer.server.graphql.model.GlobalPermissions)1 SUser (jetbrains.buildServer.users.SUser)1 NotNull (org.jetbrains.annotations.NotNull)1