How to set multiple permissions with Content Server API
I am trying to set a list of permissions on a node with CS API. If I pass a list of permissions settings, only the first gets set. I I make multiple calls, only the last value is saved. It overwrites the previous setting.
Here's the URL: PUT http://10.9.110.242/otcs/cs.exe/api/v2/nodes/418531/permissions/group HTTP/1.1
Should I be using POST here?
Here's the non-URL-encoded body:
[
{
"permissions": [
"add_items",
"edit_attributes",
"edit_permissions",
"modify",
"reserve",
"add_major_version",
"see",
"see_contents"
],
"right_id": 13164
},
{
"permissions": [
"add_items",
"edit_attributes",
"modify",
"reserve",
"add_major_version",
"see",
"see_contents"
],
"right_id": 12621
}
]
Best Answer
-
Hi Jeff,
The REST API you are using is documented as a call to update permissions on the 'owner' group. Not for multiple groups.
When you run your REST call multiple times with different right_ids, you are changing the ownergroup for that node every time. And you cannot supply multiple right_ids for the /permissions/group REST call.
Unless you are asking about changing permissions for groups in the Assigned access section?
If you look at permissions of an object in Content server, everything in Default access apart from Public access is the owner user and owner group, everything in the Assigned access is additional access permissions you have provided to users or other groups.
The rest call for the assigned access is : /v2/nodes/<nodeid>/permissions/custom
Content Server 24.3 REST API | Developer | OpenTextHope this helps.
2
Answers
-
Hi Jeff,
The REST API you are using is documented as a call to update permissions on the 'owner' group. Not for multiple groups.
When you run your REST call multiple times with different right_ids, you are changing the ownergroup for that node every time. And you cannot supply multiple right_ids for the /permissions/group REST call.
Unless you are asking about changing permissions for groups in the Assigned access section?
If you look at permissions of an object in Content server, everything in Default access apart from Public access is the owner user and owner group, everything in the Assigned access is additional access permissions you have provided to users or other groups.
The rest call for the assigned access is : /v2/nodes/<nodeid>/permissions/custom
Content Server 24.3 REST API | Developer | OpenTextHope this helps.
2 -
Thanks, I get it now. It also appears that I have to set the custom permissions per right_id, so I have to make multiple calls.
/v2/nodes/{id}/permissions/custom/{right_id} - Update the Assigned Access permission for the specified user/group
0
Categories
- All Categories
- 123 Developer Announcements
- 54 Articles
- 153 General Questions
- 148 Thrust Services
- 57 Developer Hackathon
- 37 Thrust Studio
- 20.6K Analytics
- 4.2K AppWorks
- 9K Extended ECM
- 918 Core Messaging
- 84 Digital Asset Management
- 9.4K Documentum
- 32 eDOCS
- 190 Exstream
- 39.8K TeamSite
- 1.7K Web Experience Management
- 10 XM Fax
- Follow Categories