cmem_client.repositories.access_conditions¤
Repository for the access conditions of Corporate Memory.
Provides AccessConditionsRepository for creating, updating and deleting access conditions, and for inspecting the accounts, groups and actions they can refer to.
Examples:
Inspect what access conditions can be granted to whom:
>>> from cmem_client.client import Client
>>> client = Client.from_env()
>>> client.access_conditions.get_users()
>>> client.access_conditions.get_groups()
>>> for action in client.access_conditions.get_actions():
... print(action.iri)
List the configured access conditions:
Reload the access conditions after a change:
Classes:
- AccessConditionsCreateConfig – Access condition creation config.
- AccessConditionsDeleteConfig – Access conditions delete config.
- AccessConditionsRepository – Repository for managing authorization access conditions.
- AccessConditionsUpdateConfig – Access condition update config.
AccessConditionsCreateConfig¤
Bases: CreateConfig
Access condition creation config.
Attributes:
- model_config –
AccessConditionsDeleteConfig¤
Bases: DeleteConfig
Access conditions delete config.
Attributes:
- model_config –
AccessConditionsRepository¤
Bases: PagedListRepository, DeleteItemProtocol, CreateItemProtocol, UpdateItemProtocol
Repository for managing authorization access conditions.
This repository manages access conditions that control authorization for resources in Corporate Memory. Access conditions are described with the AccessCondition model.
The repository extends PagedListRepository and implements protocols for creating and deleting access conditions.
Functions:
- create_item – Create (add) a new item to the repository
- delete_all – Delete all items from the repository
- delete_item – Delete an item from the repository
- fetch_data – Fetch a paged list from a JSON endpoint via a type adapter.
- get_actions – Return the list of actions that can be granted by access conditions.
- get_groups – Return the list of group IRIs known to the authorization system.
- get_users – Return the list of user IRIs known to the authorization system.
- items – Get the items of the repository
- keys – Get the keys of the repository
- raise_modification_error – Raise an exception if needed
- refresh – Refresh the DataPlatform access-condition cache.
- review – Review access rights for a given account and groups.
- update_item – Update an existing item in the repository.
- values – Get the values of the repository
Attributes:
- logger (
Logger) – Gets the client logger
create_item¤
Create (add) a new item to the repository
Parameters:
- item (
ItemType) – The item to add to the repository - skip_if_existing (
bool) – If true, creating already existing items will be ignored - configuration (
CreateItemConfig_contra | None) – Optional configuration
Raises:
RepositoryModificationError– if an error occurs while creating the itemHTTPError– for any other http error
delete_all¤
Delete all items from the repository
delete_item¤
Delete an item from the repository
Parameters:
- key (
str) – The key of the item to delete - skip_if_missing (
bool) – If True, it is ignored if the deleted item even exists - configuration (
DeleteItemConfig) – Optional configuration for deletion
Raises:
RepositoryModificationError– if an error occurs while creating the itemHTTPError– for any other http error
fetch_data¤
Fetch a paged list from a JSON endpoint via a type adapter.
Use this method to fetch data if your result set is a pageable spring endpoint.
get_actions¤
Return the list of actions that can be granted by access conditions.
get_groups¤
Return the list of group IRIs known to the authorization system.
get_users¤
Return the list of user IRIs known to the authorization system.
items¤
Get the items of the repository
keys¤
Get the keys of the repository
logger¤
Gets the client logger
raise_modification_error¤
Raise an exception if needed
refresh¤
Refresh the DataPlatform access-condition cache.
Instructs the DataPlatform to reload its in-memory authorization rules from the ACL graphs. Must be called after bulk SPARQL changes to ACL graphs so the DataPlatform picks up the new rules without a restart.
Raises:
HTTPStatusError– If the refresh request fails.
review¤
Review access rights for a given account and groups.
Parameters:
- account_iri (
str | None) – The IRI of the account to review. - group_iris (
list[str] | None) – Optional list of group IRIs to include in the review.
Returns:
AccessConditionReview– An AccessConditionReview model containing the review results.
update_item¤
Update an existing item in the repository.
Parameters:
- item (
ItemType) – The item to update in the repository. - configuration (
UpdateItemConfig_contra | None) – Optional configuration for the update operation.
Raises:
RepositoryModificationError– If the item does not exist or an error occurs.HTTPError– For any other HTTP error.
values¤
Get the values of the repository
AccessConditionsUpdateConfig¤
Bases: UpdateConfig
Access condition update config.
Attributes:
- model_config –