Add user permissions for runners in GraphQL API
What does this MR do and why?
This change adds a "userPermissions" field in the CiRunners type in our GraphQL API. This field communicates to the client what kind of access does the current user has to the runner.
Screenshots or screen recordings
Fields in GraphiQL:
How to set up and validate locally
- Log in as a group Owner or an Instance admin.
- Register some runners to your group
- Run the following query in the GraphQL explorer (http://gdk.test:3000/-/graphql-explorer)
Click to expand
fragment RunnerNode on CiRunner {
id
description
runnerType
shortSha
version
revision
ipAddress
active
locked
tagList
contactedAt
jobCount
projectCount
}
fragment PageInfo on PageInfo {
hasNextPage
hasPreviousPage
startCursor
endCursor
}
query getGroupRunners(
$groupFullPath: ID!
$before: String
$after: String
$first: Int
$last: Int
$status: CiRunnerStatus
$type: CiRunnerType
$search: String
$sort: CiRunnerSort
) {
group(fullPath: $groupFullPath) {
runners(
membership: DESCENDANTS
before: $before
after: $after
first: $first
last: $last
status: $status
type: $type
search: $search
sort: $sort
) {
edges {
node {
...RunnerNode
userPermissions {
readRunner
updateRunner
deleteRunner
}
}
}
pageInfo {
...PageInfo
}
}
}
}
MR acceptance checklist
This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.
-
I have evaluated the MR acceptance checklist for this MR.
Related to #337438 (closed)
Edited by Michael Kozono