Permission Sets
- class Permission_Sets(session_kwargs, client, return_type='raw')
Methods
delete_resources
(id, name)Delete a resource in a permission set
delete_resources_shares_groups
(id, name, ...)Revoke the permissions a group has on this object
delete_resources_shares_users
(id, name, user_id)Revoke the permissions a user has on this object
delete_shares_groups
(id, group_id)Revoke the permissions a group has on this object
delete_shares_users
(id, user_id)Revoke the permissions a user has on this object
get
(id)Get a Permission Set
get_resources
(id, name)Get a resource in a permission set
list
(*[, archived, author, limit, page_num, ...])List Permission Sets
list_dependencies
(id, *[, user_id])List dependent objects for this object
list_resources
(id, *[, limit, page_num, ...])List resources in a permission set
list_resources_shares
(id, name)List users and groups permissioned on this object
list_shares
(id)List users and groups permissioned on this object
list_users_permissions
(id, user_id)Get all permissions for a user, in this permission set
patch
(id, *[, name, description])Update some attributes of this Permission Set
patch_resources
(id, name, *[, description])Update a resource in a permission set
post
(name, *[, description])Create a Permission Set
post_resources
(id, name, *[, description])Create a resource in a permission set
put
(id, name, *[, description])Replace all attributes of this Permission Set
put_archive
(id, status)Update the archive status of this object
put_resources_shares_groups
(id, name, ...[, ...])Set the permissions groups has on this object
put_resources_shares_users
(id, name, ...[, ...])Set the permissions users have on this object
put_shares_groups
(id, group_ids, ...[, ...])Set the permissions groups has on this object
put_shares_users
(id, user_ids, ...[, ...])Set the permissions users have on this object
put_transfer
(id, user_id, ...[, email_body, ...])Transfer ownership of this object to another user
Examples
>>> import civis >>> client = civis.APIClient() >>> client.permission_sets.list(...)
- delete_resources(id: int, name: str) Response
Delete a resource in a permission set
- Parameters:
- idint
The ID for this permission set.
- namestr
The name of this resource.
- Returns:
- None
Response code 204: success
Revoke the permissions a group has on this object
- Parameters:
- idint
The ID for this permission set.
- namestr
The name of this resource.
- group_idint
The ID of the group.
- Returns:
- None
Response code 204: success
Revoke the permissions a user has on this object
- Parameters:
- idint
The ID for this permission set.
- namestr
The name of this resource.
- user_idint
The ID of the user.
- Returns:
- None
Response code 204: success
Revoke the permissions a group has on this object
- Parameters:
- idint
The ID of the resource that is shared.
- group_idint
The ID of the group.
- Returns:
- None
Response code 204: success
Revoke the permissions a user has on this object
- Parameters:
- idint
The ID of the resource that is shared.
- user_idint
The ID of the user.
- Returns:
- None
Response code 204: success
- get(id: int) Response
Get a Permission Set
- Parameters:
- idint
- Returns:
civis.Response
- idint
The ID for this permission set.
- namestr
The name of this permission set.
- descriptionstr
A description of this permission set.
- author
civis.Response
- idint
The ID of this user.
- namestr
This user’s name.
- usernamestr
This user’s username.
- initialsstr
This user’s initials.
- onlinebool
Whether this user is online.
- author
created_at : str (time)
updated_at : str (time)
- archivedstr
The archival status of the requested item(s).
- get_resources(id: int, name: str) Response
Get a resource in a permission set
- Parameters:
- idint
The ID for this permission set.
- namestr
The name of this resource.
- Returns:
civis.Response
- permission_set_idint
The ID for the permission set this resource belongs to.
- namestr
The name of this resource.
- descriptionstr
A description of this resource.
created_at : str (time)
updated_at : str (time)
- list(*, archived: str = None, author: str = None, limit: int = None, page_num: int = None, order: str = None, order_dir: str = None, iterator: bool = None) list[Response] | PaginatedResponse
List Permission Sets
- Parameters:
- archivedstr, optional
The archival status of the requested item(s).
- authorstr, optional
If specified, return items from any of these authors. It accepts a comma- separated list of user IDs.
- limitint, optional
Number of results to return. Defaults to 20. Maximum allowed is 50.
- page_numint, optional
Page number of the results to return. Defaults to the first page, 1.
- orderstr, optional
The field on which to order the result set. Defaults to updated_at. Must be one of: updated_at, name, created_at.
- order_dirstr, optional
Direction in which to sort, either asc (ascending) or desc (descending) defaulting to desc.
- iteratorbool, optional
If True, return a generator (specifically, a
civis.PaginatedResponse
object) to iterate over all responses. Use it when more results than the maximum allowed by ‘limit’ are needed. When True, ‘page_num’ is ignored. If False, return a list ofcivis.Response
objects, whose size is determined by ‘limit’. Defaults to False.
- Returns:
civis.PaginatedResponse
- idint
The ID for this permission set.
- namestr
The name of this permission set.
- descriptionstr
A description of this permission set.
- author
civis.Response
- idint
The ID of this user.
- namestr
This user’s name.
- usernamestr
This user’s username.
- initialsstr
This user’s initials.
- onlinebool
Whether this user is online.
- author
created_at : str (time)
updated_at : str (time)
- archivedstr
The archival status of the requested item(s).
- list_dependencies(id: int, *, user_id: int = None) Response
List dependent objects for this object
- Parameters:
- idint
The ID of the resource that is shared.
- user_idint, optional
ID of target user
- Returns:
civis.Response
- object_typestr
Dependent object type
- fco_typestr
Human readable dependent object type
- idint
Dependent object ID
- namestr
Dependent object name, or nil if the requesting user cannot read this object
- permission_levelstr
Permission level of target user (not user’s groups) for dependent object. Null if no target user or not shareable (e.g. a database table).
- descriptionstr
Additional information about the dependency, if relevant
- shareablebool
Whether or not the requesting user can share this object.
- list_resources(id: int, *, limit: int = None, page_num: int = None, order: str = None, order_dir: str = None, iterator: bool = None) list[Response] | PaginatedResponse
List resources in a permission set
- Parameters:
- idint
The ID for this permission set.
- limitint, optional
Number of results to return. Defaults to 50. Maximum allowed is 1000.
- page_numint, optional
Page number of the results to return. Defaults to the first page, 1.
- orderstr, optional
The field on which to order the result set. Defaults to name. Must be one of: name, id, updated_at, created_at.
- order_dirstr, optional
Direction in which to sort, either asc (ascending) or desc (descending) defaulting to asc.
- iteratorbool, optional
If True, return a generator (specifically, a
civis.PaginatedResponse
object) to iterate over all responses. Use it when more results than the maximum allowed by ‘limit’ are needed. When True, ‘page_num’ is ignored. If False, return a list ofcivis.Response
objects, whose size is determined by ‘limit’. Defaults to False.
- Returns:
civis.PaginatedResponse
- permission_set_idint
The ID for the permission set this resource belongs to.
- namestr
The name of this resource.
- descriptionstr
A description of this resource.
created_at : str (time)
updated_at : str (time)
List users and groups permissioned on this object
- Parameters:
- idint
The ID for this permission set.
- namestr
The name of this resource.
- Returns:
civis.Response
- readers
civis.Response
- usersList[
civis.Response
] id : int
name : str
- usersList[
- groupsList[
civis.Response
] id : int
name : str
- groupsList[
- readers
- writers
civis.Response
- usersList[
civis.Response
] id : int
name : str
- usersList[
- groupsList[
civis.Response
] id : int
name : str
- groupsList[
- writers
- owners
civis.Response
- usersList[
civis.Response
] id : int
name : str
- usersList[
- groupsList[
civis.Response
] id : int
name : str
- groupsList[
- owners
- total_user_sharesint
For owners, the number of total users shared. For writers and readers, the number of visible users shared.
- total_group_sharesint
For owners, the number of total groups shared. For writers and readers, the number of visible groups shared.
List users and groups permissioned on this object
- Parameters:
- idint
The ID of the resource that is shared.
- Returns:
civis.Response
- readers
civis.Response
- usersList[
civis.Response
] id : int
name : str
- usersList[
- groupsList[
civis.Response
] id : int
name : str
- groupsList[
- readers
- writers
civis.Response
- usersList[
civis.Response
] id : int
name : str
- usersList[
- groupsList[
civis.Response
] id : int
name : str
- groupsList[
- writers
- owners
civis.Response
- usersList[
civis.Response
] id : int
name : str
- usersList[
- groupsList[
civis.Response
] id : int
name : str
- groupsList[
- owners
- total_user_sharesint
For owners, the number of total users shared. For writers and readers, the number of visible users shared.
- total_group_sharesint
For owners, the number of total groups shared. For writers and readers, the number of visible groups shared.
- list_users_permissions(id: int, user_id: int) Response
Get all permissions for a user, in this permission set
- Parameters:
- idint
The ID for this permission set.
- user_idint
The ID for the user.
- Returns:
civis.Response
- resource_namestr
The name of the resource.
- readbool
If true, the user has read permission on this resource.
- writebool
If true, the user has write permission on this resource.
- managebool
If true, the user has manage permission on this resource.
- patch(id: int, *, name: str = None, description: str = None) Response
Update some attributes of this Permission Set
- Parameters:
- idint
The ID for this permission set.
- namestr, optional
The name of this permission set.
- descriptionstr, optional
A description of this permission set.
- Returns:
civis.Response
- idint
The ID for this permission set.
- namestr
The name of this permission set.
- descriptionstr
A description of this permission set.
- author
civis.Response
- idint
The ID of this user.
- namestr
This user’s name.
- usernamestr
This user’s username.
- initialsstr
This user’s initials.
- onlinebool
Whether this user is online.
- author
created_at : str (time)
updated_at : str (time)
- archivedstr
The archival status of the requested item(s).
- patch_resources(id: int, name: str, *, description: str = None) Response
Update a resource in a permission set
- Parameters:
- idint
The ID for this permission set.
- namestr
The name of this resource.
- descriptionstr, optional
A description of this resource.
- Returns:
civis.Response
- permission_set_idint
The ID for the permission set this resource belongs to.
- namestr
The name of this resource.
- descriptionstr
A description of this resource.
created_at : str (time)
updated_at : str (time)
- post(name: str, *, description: str = None) Response
Create a Permission Set
- Parameters:
- namestr
The name of this permission set.
- descriptionstr, optional
A description of this permission set.
- Returns:
civis.Response
- idint
The ID for this permission set.
- namestr
The name of this permission set.
- descriptionstr
A description of this permission set.
- author
civis.Response
- idint
The ID of this user.
- namestr
This user’s name.
- usernamestr
This user’s username.
- initialsstr
This user’s initials.
- onlinebool
Whether this user is online.
- author
created_at : str (time)
updated_at : str (time)
- archivedstr
The archival status of the requested item(s).
- post_resources(id: int, name: str, *, description: str = None) Response
Create a resource in a permission set
- Parameters:
- idint
The ID for this permission set.
- namestr
The name of this resource.
- descriptionstr, optional
A description of this resource.
- Returns:
civis.Response
- permission_set_idint
The ID for the permission set this resource belongs to.
- namestr
The name of this resource.
- descriptionstr
A description of this resource.
created_at : str (time)
updated_at : str (time)
- put(id: int, name: str, *, description: str = None) Response
Replace all attributes of this Permission Set
- Parameters:
- idint
The ID for this permission set.
- namestr
The name of this permission set.
- descriptionstr, optional
A description of this permission set.
- Returns:
civis.Response
- idint
The ID for this permission set.
- namestr
The name of this permission set.
- descriptionstr
A description of this permission set.
- author
civis.Response
- idint
The ID of this user.
- namestr
This user’s name.
- usernamestr
This user’s username.
- initialsstr
This user’s initials.
- onlinebool
Whether this user is online.
- author
created_at : str (time)
updated_at : str (time)
- archivedstr
The archival status of the requested item(s).
- put_archive(id: int, status: bool) Response
Update the archive status of this object
- Parameters:
- idint
The ID of the object.
- statusbool
The desired archived status of the object.
- Returns:
civis.Response
- idint
The ID for this permission set.
- namestr
The name of this permission set.
- descriptionstr
A description of this permission set.
- author
civis.Response
- idint
The ID of this user.
- namestr
This user’s name.
- usernamestr
This user’s username.
- initialsstr
This user’s initials.
- onlinebool
Whether this user is online.
- author
created_at : str (time)
updated_at : str (time)
- archivedstr
The archival status of the requested item(s).
Set the permissions groups has on this object
- Parameters:
- idint
The ID for this permission set.
- namestr
The name of this resource.
- group_idsList[int]
An array of one or more group IDs.
- permission_levelstr
Options are: “read”, “write”, or “manage”.
- share_email_bodystr, optional
Custom body text for e-mail sent on a share.
- send_shared_emailbool, optional
Send email to the recipients of a share.
- Returns:
civis.Response
- readers
civis.Response
- usersList[
civis.Response
] id : int
name : str
- usersList[
- groupsList[
civis.Response
] id : int
name : str
- groupsList[
- readers
- writers
civis.Response
- usersList[
civis.Response
] id : int
name : str
- usersList[
- groupsList[
civis.Response
] id : int
name : str
- groupsList[
- writers
- owners
civis.Response
- usersList[
civis.Response
] id : int
name : str
- usersList[
- groupsList[
civis.Response
] id : int
name : str
- groupsList[
- owners
- total_user_sharesint
For owners, the number of total users shared. For writers and readers, the number of visible users shared.
- total_group_sharesint
For owners, the number of total groups shared. For writers and readers, the number of visible groups shared.
Set the permissions users have on this object
- Parameters:
- idint
The ID for this permission set.
- namestr
The name of this resource.
- user_idsList[int]
An array of one or more user IDs.
- permission_levelstr
Options are: “read”, “write”, or “manage”.
- share_email_bodystr, optional
Custom body text for e-mail sent on a share.
- send_shared_emailbool, optional
Send email to the recipients of a share.
- Returns:
civis.Response
- readers
civis.Response
- usersList[
civis.Response
] id : int
name : str
- usersList[
- groupsList[
civis.Response
] id : int
name : str
- groupsList[
- readers
- writers
civis.Response
- usersList[
civis.Response
] id : int
name : str
- usersList[
- groupsList[
civis.Response
] id : int
name : str
- groupsList[
- writers
- owners
civis.Response
- usersList[
civis.Response
] id : int
name : str
- usersList[
- groupsList[
civis.Response
] id : int
name : str
- groupsList[
- owners
- total_user_sharesint
For owners, the number of total users shared. For writers and readers, the number of visible users shared.
- total_group_sharesint
For owners, the number of total groups shared. For writers and readers, the number of visible groups shared.
Set the permissions groups has on this object
- Parameters:
- idint
The ID of the resource that is shared.
- group_idsList[int]
An array of one or more group IDs.
- permission_levelstr
Options are: “read”, “write”, or “manage”.
- share_email_bodystr, optional
Custom body text for e-mail sent on a share.
- send_shared_emailbool, optional
Send email to the recipients of a share.
- Returns:
civis.Response
- readers
civis.Response
- usersList[
civis.Response
] id : int
name : str
- usersList[
- groupsList[
civis.Response
] id : int
name : str
- groupsList[
- readers
- writers
civis.Response
- usersList[
civis.Response
] id : int
name : str
- usersList[
- groupsList[
civis.Response
] id : int
name : str
- groupsList[
- writers
- owners
civis.Response
- usersList[
civis.Response
] id : int
name : str
- usersList[
- groupsList[
civis.Response
] id : int
name : str
- groupsList[
- owners
- total_user_sharesint
For owners, the number of total users shared. For writers and readers, the number of visible users shared.
- total_group_sharesint
For owners, the number of total groups shared. For writers and readers, the number of visible groups shared.
Set the permissions users have on this object
- Parameters:
- idint
The ID of the resource that is shared.
- user_idsList[int]
An array of one or more user IDs.
- permission_levelstr
Options are: “read”, “write”, or “manage”.
- share_email_bodystr, optional
Custom body text for e-mail sent on a share.
- send_shared_emailbool, optional
Send email to the recipients of a share.
- Returns:
civis.Response
- readers
civis.Response
- usersList[
civis.Response
] id : int
name : str
- usersList[
- groupsList[
civis.Response
] id : int
name : str
- groupsList[
- readers
- writers
civis.Response
- usersList[
civis.Response
] id : int
name : str
- usersList[
- groupsList[
civis.Response
] id : int
name : str
- groupsList[
- writers
- owners
civis.Response
- usersList[
civis.Response
] id : int
name : str
- usersList[
- groupsList[
civis.Response
] id : int
name : str
- groupsList[
- owners
- total_user_sharesint
For owners, the number of total users shared. For writers and readers, the number of visible users shared.
- total_group_sharesint
For owners, the number of total groups shared. For writers and readers, the number of visible groups shared.
- put_transfer(id: int, user_id: int, include_dependencies: bool, *, email_body: str = None, send_email: bool = None) Response
Transfer ownership of this object to another user
- Parameters:
- idint
The ID of the resource that is shared.
- user_idint
ID of target user
- include_dependenciesbool
Whether or not to give manage permissions on all dependencies
- email_bodystr, optional
Custom body text for e-mail sent on transfer.
- send_emailbool, optional
Send email to the target user of the transfer?
- Returns:
civis.Response
- dependenciesList[
civis.Response
] Dependent objects for this object
- object_typestr
Dependent object type
- fco_typestr
Human readable dependent object type
- idint
Dependent object ID
- namestr
Dependent object name, or nil if the requesting user cannot read this object
- permission_levelstr
Permission level of target user (not user’s groups) for dependent object. Null if no target user or not shareable (e.g. a database table).
- descriptionstr
Additional information about the dependency, if relevant
- sharedbool
Whether dependent object was successfully shared with target user
- dependenciesList[