I am attempting to set permissions for spaces, and want to use a single API call to set all the permissions I want at once.
Whenever I try building my payload though, only one permission is set, and it's always the last permission in the list.
I've tried both the below method, and just using multiple operation objects, and both have the same problem.
I could of course use a single call per permission, but I have hundreds of spaces, and want to set 3-5 permissions per space, that's a *ton* of calls.
Here's the python I've got:
payload = json.dumps({
"subject": {
"identifier": <GroupID>,
"type": "group"
},
"operation": {
"key": "read",
"target": "space",
"key": "delete",
"target": "space",
"key": "create",
"target": "comment",
"key": "create",
"target": "attachment"
},
"_links": {}
})
response = requests.request("POST", url, headers=ConfluenceVars.headers, data=payload, verify=False)
It's only one permission as per the documentation
in this doc
Call multiple API to set multiple permissions for either user or a group
Thanks,
Pramodh
"At least one" implies that I can send more than one if I wanted to.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You can not set multiple keys with same string in dictionary object , it will overwrite and use only one unique. In order to send multiple operation calls in one , just pass multiple operation dictionary object in the same call using "list of dictionary". Please refer below.
operations": [ { "key": "read", "target": "page"},
{ "key": "create", "target": "page"}
]
Same has been described in the docs also , although you need to use different endpoint also.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
This doesn't work right?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
don't think this works, any update?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.