User Groups

Manage user groups.

See Manage Permissions to learn how permissions work in GoodData.

Entity Methods

Declarative Methods

Example

List, create and delete user groups:

from gooddata_sdk import GoodDataSdk, CatalogUserGroup

# GoodData base URL, e.g. "https://www.example.com"
host = "https://www.example.com"
# GoodData user token
token = "some_user_token"
sdk = GoodDataSdk.create(host, token)

# List user groups
user_groups = sdk.catalog_user.list_user_groups()

print(user_groups)
#[
#    CatalogUserGroup()
#        id='adminGroup',
#        relationships=None
#    ),
#    CatalogUserGroup(id='adminQA1Group',
#        relationships=CatalogUserGroupRelationships(
#           parents=CatalogUserGroupParents(
#               data=[
#                   CatalogUserGroup(
#                        id='adminGroup',
#                        relationships=None
#                    )
#                ]
#            )
#        )
#    )
#    ...
#]

# Define user group
user_group = CatalogUserGroup.init(user_group_id="xyz", user_group_parent_ids=["demoGroup"])

# Create user group
sdk.catalog_user.create_or_update_user_group(user_group=user_group)

# Delete user group
sdk.catalog_user.delete_user_group(user_group_id=user_group.id)