Policies client

The SDK provides a Policies client to provide read and update operations on policies. These are created in and deleted from Sitecore Content Hub internally only. Externally, they can only be retrieved or modified.

Get user policies

To get a user's policy, use GetUserPolicyAsync:

RequestResponse

var policy = await MClient.Policies.GetUserPolicyAsync(userId);

Get user group policies

Similar to getting a user group's policy, use GetUserGroupPolicyAsync:

RequestResponse

var policy = await MClient.Policies.GetUserGroupPolicyAsync(userGroupId);

Update policies

After making changes to policies, they can be updated as follows:

RequestResponse

await MClient.Policies.UpdateAsync(policy);

Do you have some feedback for us?

If you have suggestions for improving this article,