Skip to main content

Groups

A group is a collection of users of an organization. Groups form a tree, with the organization at the root, so that they can mirror the structure of a company. A user can belong to several groups.

Group properties​

PropertyDescription
ownerOrganization that the group belongs to
nameUnique name of the group
displayNameName shown in the UI
createdTime, updatedTimeTime of creation and of the last change
typePhysical or Virtual. A user can be in one physical group only and in any number of virtual groups
parentGroupParent of the group. The parent of a top-level group is the organization
propertiesKey-value map for your own metadata

Manage groups​

You manage groups in three places of the Casdoor admin console.

On the Groups page, which lists all groups:

Groups list page

In the group tree of an organization. To open it, click Groups in the row of the organization on the Organizations page:

Groups button in the organization list

Group tree of an organization

Recording of the group tree page

On the edit page of a user, where you assign the user to groups:

Groups field of a user

Read groups through the API​

GET /api/get-group?id=<organization>/<group> returns one group, and GET /api/get-groups?owner=<organization> returns the groups of an organization. Both fill the users field with the IDs of the group's members.

Looking up the members of a group reads all user-group assignments. When you only need the group itself, for example to check whether it exists before a sync creates or updates it, add withUsers=false and get-group leaves users empty:

curl "https://door.casdoor.com/api/get-group?id=<organization>/<group>&withUsers=false" \
-H "Authorization: Bearer <access-token>"

See also​