Skip to main content
start

Policies

Policies determine who is allowed to perform specific actions. You can define your policy on two levels: for a Context or for a Container (Thread, Store etc).

This section covers policies in the Containers' scope.

Overview

Setting a policy in the Container overwrites the policy from the Context. Some of the Containers (Threads, Stores) can include items (messages, files), which have their own policy. Properties of a policy can be set to one of the following values:

  • "default" - takes the default value
  • "inherit" - takes value from the Context (can be used only in the Container policy)
  • "none" - no one can perform this action
  • "all" - all Context users can perform this action
  • "user" - all Container users can perform this action
  • "manager" - all Container managers can perform this action
  • "owner" - only Container owner can perform this action
  • "itemOwner" - only item owner can perform this action (can be used only in the item policy)

You can also combine the values listed above. If you want to allow item updates to be executed only by the item owner, with the additional assumption that they must be an active user of the Container, you can write itemOwner&user. But if you also want to allow the Container managers to update the item, you can write itemOwner&user,manager. In a policy entry, the & character means 'and', and the coma , means 'or'.

Default policy values

The Endpoint can only define policies on the level of Containers and items. Context level policies include rules connected to, for example, creating Containers – so they have to be defined using Bridge server API. The list of default policies for a Context level can be found in PrivMX Bridge API.

Policies manageable by Endpoint on Container level

Policies for Containers with items

The following table defines access and management rules for Containers with items.

ContainerPolicytypeEnumDescription
itemItemPolicy(optional) Container's items policy
getstring(optional) Determines who can get a Container
updatestring(optional) Determines who can update a Container
deletestring(optional) Determines who can update a Container
updatePolicystring(optional) Determines who can update policy
updaterCanBeRemovedFromManagersstringinherit
yes
no
default
(optional) Determines whether the updater can be removed from the list of managers
ownerCanBeRemovedFromManagersstringinherit
yes
no
default
(optional) Determines whether the owner can be removed from the list of managers

Policies for Containers without items

The following table defines access and management rules for Containers without items.

ContainerPolicyWithoutItemtypeEnumDescription
getstring(optional) Determines who can get a Container
updatestring(optional) Determines who can update a Container
deletestring(optional) Determines who can update a Container
updatePolicystring(optional) Determines who can update policy
updaterCanBeRemovedFromManagersstringinherit
yes
no
default
(optional) Determines whether the updater can be removed from the list of managers
ownerCanBeRemovedFromManagersstringinherit
yes
no
default
(optional) Determines whether the owner can be removed from the list of managers

Policies for items

ItemPolicytypeEnumDescription
getstring(optional) Determines who can get an item
listMystring(optional) Determines who can list elements created by themselves
listAllstring(optional) Determines who can list all items (this policy sets the behavior of methods such as listMessages, listFiles, listEntries)
createstring(optional) Determines who can create an item
updatestring(optional) Determines who can update an item
deletestring(optional) Determines who can update an item