/
Access Control Service (python)
NOTE: Trivore ID Documentation has moved to https://trivoreid.com
The content on this site IS OUT OF DATE!
This space has been archived!
Please go ahead to the new site!
Access Control Service (python)
Wrapper for '/accesscontrol' endpoint. For more information see Entity Access Control.
Access control object management
from trivoreid.utils.criteria import Filter
from trivoreid.models.accesscontrol import AccessControl
# get page with the first 5 access controls with the 'userId' in userIdWrite list
f = Filter(Filter.CONTAINS, 'userIdWrite', 'userId')
page = api.accesscontrol_service.get_all(f,
start_index=0,
count=5,
sortBy='attribute',
ascending=True)
# create new access control
access = AccessControl()
# the function returns access control object with the generated id
access = api.accesscontrol_service.create(access)
# update access control
access.description = 'Example description'
access = api.accesscontrol_service.update(access)
# get access control
access = api.accesscontrol_service.get(access.id)
# delete access control
api.accesscontrol_service.delete(access.id)