How to know if a user, not the one logged in, has permission to access a camera?
Many Thanks,
Frediano
How to know if a user, not the one logged in, has permission to access a camera?
Many Thanks,
Frediano
You can use
--
static bool VideoOS.Platform.Util.SecurityAccess.IsMember( ServerId serverId, string sidIdentity, string roleId)
-
This method will check if the user identified by the provided identity is part of a specific role.
Parameters
serverId Server on which the role exists
sidIdentity Identity of the user to check
roleId The role to check
--
Note. For a Windows user the SID is something you will need to ask Windows, hope you can find a method, for Basic users it is a Guid and you can find the users using Configuration API (CA).
I envision a solution where you
· Use CA to find all roles
· Use IsMember to find if the user belongs to a role
· Use CA to find the Camera
· Still using CA use the Camera method Edit permissions for each Role to see permissions.
I have not made the code, have not tested this, but I am confident it will work. Let me know.
Many Thanks Rie, I’ll implement and test the method then I inform you of results
Freddy
Hi @Rie Kiuchi (Milestone Systems)
Any Sample plugin integration that checks camera permissions from roles.
How to use in plugin integration
Thanks,
Vikas
Regarding IsMember, there is no sample but please see this Forum question, it might be helpful for you to see how to use IsMember - https://developer.milestonesys.com/s/question/0D53X0000AO5kI7SQJ/check-if-the-logged-in-user-is-member-of-a-specific-role
CheckPermission, please see this sample. There are some code using CheckPermission so it might be helpful.