website/docs: adds code examples for getting user objects from a group object (#14101)
* Added example of how to get user objects fro a group object * Updated wording * Updated wording, added titles to examples, capitalised group, added explanation of examples * Update website/docs/users-sources/groups/group_ref.md Co-authored-by: Tana M Berry <tanamarieberry@yahoo.com> Signed-off-by: Dewi Roberts <dewi@goauthentik.io> * Update website/docs/users-sources/groups/group_ref.md Co-authored-by: Tana M Berry <tanamarieberry@yahoo.com> Signed-off-by: Dewi Roberts <dewi@goauthentik.io> * Update website/docs/users-sources/groups/group_ref.md Co-authored-by: Tana M Berry <tanamarieberry@yahoo.com> Signed-off-by: Dewi Roberts <dewi@goauthentik.io> * Update website/docs/users-sources/groups/group_ref.md Co-authored-by: Tana M Berry <tanamarieberry@yahoo.com> Signed-off-by: Dewi Roberts <dewi@goauthentik.io> * Update website/docs/users-sources/groups/group_ref.md Co-authored-by: Tana M Berry <tanamarieberry@yahoo.com> Signed-off-by: Dewi Roberts <dewi@goauthentik.io> * Update website/docs/users-sources/groups/group_ref.md Co-authored-by: Tana M Berry <tanamarieberry@yahoo.com> Signed-off-by: Dewi Roberts <dewi@goauthentik.io> * Update website/docs/users-sources/groups/group_ref.md Co-authored-by: Tana M Berry <tanamarieberry@yahoo.com> Signed-off-by: Dewi Roberts <dewi@goauthentik.io> * Changes based on Tana's feedback * Word * Capitalization --------- Signed-off-by: Dewi Roberts <dewi@goauthentik.io> Co-authored-by: Tana M Berry <tanamarieberry@yahoo.com>
This commit is contained in:
@ -4,13 +4,32 @@ title: Group properties and attributes
|
||||
|
||||
## Object properties
|
||||
|
||||
The Group object has the following properties:
|
||||
The group object has the following properties:
|
||||
|
||||
- `name` Group's display name.
|
||||
- `is_superuser` Boolean field if the group's users are superusers.
|
||||
- `parent` The parent Group of this Group.
|
||||
- `attributes` Dynamic attributes, see [Attributes](#attributes)
|
||||
- `name`: The group's display name.
|
||||
- `is_superuser`: A boolean field that determines if the group's users are superusers.
|
||||
- `parent`: The parent group of this group.
|
||||
- `attributes`: Dynamic attributes, see [Attributes](#attributes).
|
||||
|
||||
## Examples
|
||||
|
||||
These are examples of how group objects can be used within authentik policies and property mappings.
|
||||
|
||||
### List all group members
|
||||
|
||||
Use the following examples to list all users that are members of a group:
|
||||
|
||||
```python title="Get all members of a group object"
|
||||
group.users.all()
|
||||
```
|
||||
|
||||
```python title="Specify a group object based on name and return all of its members"
|
||||
from authentik.core.models import Group
|
||||
Group.objects.get(name="name of group").users.all()
|
||||
```
|
||||
|
||||
## Attributes
|
||||
|
||||
By default, authentik group objects are created with no attributes, however custom attributes can be set.
|
||||
|
||||
See [the user reference](../user/user_ref.mdx#attributes) for well-known attributes.
|
||||
|
Reference in New Issue
Block a user