How can I change rights for devices in roles with the API Gateway?
The closest i can find is this,
How can I change rights for devices in roles with the API Gateway?
The closest i can find is this,
You need to use the task ChangeSecurityPermissions on the Camera…
I did a quick test.
Thank you, I also see that the “result” shows the altered rights as well. I also need to retrieve this in my script, but this is not the proper way to do that I guess? Powershell definiteley does not like it when i send without “VIEW_LIVE”. The gateway then returnes a “204 No Content” (which PowerShell sees as an error) or a JSON body that needs to be extracted differently i guess? Is can’t find this in the API reference either, guess I am searching for all the wrong things there.
I did some research.
When I do (testing in Postman)
…
POST /api/rest/v1/cameras/b682b05a-83f1-487d-98da-4494479a43da?task=ChangeSecurityPermissions
{
“userPath”: {
"type": "roles",
"id": "a6cba871-e5be-4606-a748-6c304bbc6703"
}
}
…
filling no fields to set, I get a 400 Bad request, yet I get the readout of all the values. But clearly it is bad to use a POST this way, and the errors we get also says so.
So the question is if there is an option that allows you to read the permissions. Unfortunately, I found that there isn’t. Using SecurityNamespaces and EffectivePermissions you can read to permissions for the role you are currently logged in as, but you cannot as an Administrator read the permissions for other roles.
Discussing it with Milestone Development we thought it would be a good idea to be able to read this for other roles, so we will make a note of it that it might be considered for future enhancement development work.
Is it possible to use task=ChangeSecurityPermissions directly on a device group? That would save me a great deal of API calls.
It has been discussed, at Milestone Development, to have some sort of server-side bulk updates and it could be governed by using the device group. While a good suggestion, it hasn’t currently been prioritized or planned for future enhancement development work.