Skip to content

Commit

Permalink
Add rbac helper queries to docs (PrefectHQ#4721)
Browse files Browse the repository at this point in the history
* Add rbac helper queries to docs

* Add changelog
  • Loading branch information
zangell44 authored Jul 1, 2021
1 parent 278c172 commit d61fa6a
Show file tree
Hide file tree
Showing 2 changed files with 43 additions and 0 deletions.
3 changes: 3 additions & 0 deletions changes/pr4721.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
enhancement:
- "Add documentation for querying role and membership info - [#4721](https://github.com/PrefectHQ/prefect/pull/4721)"

40 changes: 40 additions & 0 deletions docs/orchestration/rbac/overview.md
Original file line number Diff line number Diff line change
Expand Up @@ -87,3 +87,43 @@ mutation {
```

When assigning a role to a user or service account, a user cannot assign a role that has more permissions than they possess.

### Querying for Role Information

To list available Default and Custom roles and their corresponding permissions, run the following query

```graphql
query {
auth_role {
created
id
name
permissions
}
}
```

The `id` value for a given role should be provided as the `role_id` parameter when calling `set_membership_role` or updating/deleting custom roles.

### Querying for Membership Information

To list all users and their membership ids in the current tenant, run the following query


```graphql
query {
user_view_same_tenant {
id
account_type
email
first_name
last_name
username
memberships {
id
}
}
}
```

The `memberships.id` value for a given user should be provided as the `membership_id` parameter when calling `set_membership_role`.

0 comments on commit d61fa6a

Please sign in to comment.