Call to get all Users under the specified Role.

Hello,

I’m wondering if there is a way to retrieve all cameras associated with a particular role?

We have been using Management.RolesFolder.Roles, but it seems that there is no provision for this functionality. Currently, we are utilizing VideoOS.Platform.ConfigurationItems.Camera and implementing the ChangeSecurityPermissions method, where we pass all roles and check the task.GetProperty(“GENERIC_READ”) value to determine if the camera has access.

This process of identifying the role for each camera on the customer site, with 300 roles and 3900 cameras, is extremely time-consuming, taking approximately 20 hours.

Is there an alternative approach or solution to efficiently determine the role for each camera?

Thanks

Team Vega

The recommended way is the other way around, instead of looping through camera objects for the one user check whether access is allowed.

The recommended way to implement this form for security is to use VideoOS.Platform.Util.SecurityAccess.CheckPermission

https://doc.developer.milestonesys.com/html/index.html?base=miphelp/class_video_o_s_1_1_platform_1_1_util_1_1_security_access.html&tree=tree_search.html?search=securityaccess

We have a sample that is not in the official set of samples that shows access to a plugin, I think you will find the access to a camera is very similar. - https://developer.milestonesys.com/s/article/using-roles-regulate-access-to-specific-MIP-SDK-plugin-how-to

We need to find cameras with read permission under each role.

One idea that might work.

  1. Create a basic user.
  2. Add the user to a role – and then login as that basic user and ask for all cameras.
  3. Remove the user again from the role.
  4. For the next role to check loop back to 2.