How to retrieve all cameras and camera security permission associated with a user?

We use the Milestone product XProtect Corporate 2022 R2 and we want integrate it with a java application in a linux environment:

  1. How can we get a list of cameras associated/attached with a user?
  2. How to I retrieve the camera security permissions a user has (Read, viewLive, LockPTZ_presets, playback…)?

You might want to use ServerCommandService in order to get camera list. TCP Video Viewer sample might be helpful to see - https://doc.developer.milestonesys.com/html/index.html?base=samples/protocolsamples/tcpvideoviewer/readme.html&tree=tree_3.html

There is no Java sample in MIP SDK samples but there are C# samples, and it may give you an inspiration.

Please see ConfigAPI Client sample - https://doc.developer.milestonesys.com/html/index.html?base=samples/componentsamples/configapiclient/readme.html&tree=tree_2.html

Go to Roles and select a Role and see Rolemember.

And then, as you can see below: Edit overall security permissions – select Cameras then you will see Read, viewLive, LockPTZ_presets, playback etc.

NOTE – a user can be a member of multiple groups: you need to check all groups who is members of the groups.

@Rie Kiuchi (Milestone Systems)​, thank you for your responses.

  1. In relation to the first question/response, we need to retrieve the cameras that an user can access. With the soap service “ServerCommandService”(operation “GetConfiguration”) of the sample TCP Video Viewer , the information gaven is all cameras of system.

We only want query the cameras that an user can access by his username or sid.

  1. In relation to the second question/response, if we use the SOAP Configuration API service of the sample (operations: “GetItem” and “GetChildItems”), the roles’s childrens, we can view the users/members list, and the claims, but the Security Permissions not exist in the tree of items.

The role members are users associated to the role, but they haven’t attributes or properties with the security permissions:

If the new Milestone Integration Restful API (API Gateway) is used, the information is similar: Roles only have rolemembers/users and claims, but the security permisions don’t exists:

Rolemembers/users of a Role:

  1. When you use ServerCommandService and get the configuration you get it for the user that you are logging in with. So if you are trying in the context of an admin user you will get everything and not be able to see what other users might get.
    
  2. I am sorry, I wrote wrong instructions in the previous post. You might want to see rather camera – permission in ConfigAPI Client. Please see below.