VideoOS.Platform.Util.SecurityAccess Class Reference

This class assists in maintaining security access for Items and validating what Items a user can access. The plug-in must be sure to register and unregister the Items that is under access control, e.g. has a SecurityAccess defined. This could be done in the ItemManager.ValidateAndSaveUserControl method with a call to RegisterItem(Item) and in the ItemManager.DeleteItem(Item) with a call to UnregisterItem(Item). More...

Static Public Member Functions

static List< ItemBuildPermissionList (List< Item > items, string actionId)
 Check authorization for a list of Items. The items the current user can access with defined action is returned.
 
static List< ItemBuildPermissionList (List< Item > items, string actionId, ServerId serverId)
 Check authorization for a list of Items. The items the current user can access with defined action is returned.
 
static List< ItemBuildPermissionList (List< Item > items, string actionId, string SID, List< string > groups)
 Check authorization for a list of Items. The items the specified user can access with defined action is returned.
 
static void CheckPermission (Guid pluginDefinitionId, string actionId)
 This method will check if current user can perform the requested action on this Plugin. Will throw Exception if access is denied.
 
static void CheckPermission (Guid pluginDefinitionId, string actionId, ServerId serverId)
 This method will check if current user can perform the requested action on this Plug-in, when working on items from a given server. Will throw Exception if access is denied.
 
static void CheckPermission (Guid pluginDefinitionId, string actionId, string SID)
 This method will check if current user can perform the requested action on this Plug-in. Will throw Exception if access is denied.
 
static void CheckPermission (Guid pluginDefinitionId, string actionId, string SID, List< string > groups)
 This method will check if current user can perform the requested action on this Plug-in. Will throw Exception if access is denied.
 
static void CheckPermission (Item item, string actionId)
 This method will check if current user can perform the requested action on this Item. Will throw Exception if access is denied.
 
static void CheckPermission (Item item, string actionId, ServerId serverId)
 This method will check if current user can perform the requested action on this Item. Will throw Exception if access is denied.
 
static void CheckPermission (Item item, string actionId, string SID)
 This method will check if current user can perform the requested action on this Item. Will throw Exception if access is denied. The user to check is identified by the SID.
 
static void CheckPermission (Item item, string actionId, string SID, List< string > groups)
 This method will check if current user can perform the requested action on this Item. Will throw Exception if access is denied. The user to check is identified by the SID.
 
static void CheckPermission (PluginDefinition pluginDefinition, string actionId)
 This method will check if current user can perform the requested action on this Plug-in. Will throw Exception if access is denied.
 
static void CheckPermission (PluginDefinition pluginDefinition, string actionId, ServerId serverId)
 This method will check if current user can perform the requested action on this Plug-in. Will throw Exception if access is denied.
 
static void Flush ()
 For internal use.
 
static Collection< String > GetPermittedActionList (Item item, String SID)
 Get the permitted action list for a specific user working with specific Item.
 
static Collection< String > GetPermittedActionList (Item item, String SID, ServerId serverId)
 Get the permitted action list for a specific user working with specific Item on a specific Server.
 
static UserIdentification GetUserIdentificationViaSid (String sid, LoginSettings loginSettings)
 Get hold of information about an AD user, or a basic user.
 
static bool HasOverallPermission (ServerId serverId, string securityNamespaceName, string securityAction)
 Check to see if current user has permission on an overall area.
 
static bool IsClientAllowed (ServerId serverId, string clientType)
 Can be used to check if a given client type is allowed to connect to the VMS server.
 
static bool 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.
 
static void Logoff ()
 Is called internally when the user logs off.
 
static void Logout (LoginSettings loginSettings)
 Called when one user logs out.
 
static void RegisterItem (Item item)
 When a new Item is created and is under security check, this method need to be called.
 
static void Reload ()
 For internal use.
 
static void Save ()
 For internal use.
 
static void UnregisterItem (Item item)
 When an Item is being deleted, this method need to be called.
 

Static Public Attributes

static readonly Guid AdministratorRoleId = new Guid("1f30d14b-ba91-4e8a-8838-eda17931f8fc")
 Identify the administrator role.
 

Detailed Description

This class assists in maintaining security access for Items and validating what Items a user can access. The plug-in must be sure to register and unregister the Items that is under access control, e.g. has a SecurityAccess defined. This could be done in the ItemManager.ValidateAndSaveUserControl method with a call to RegisterItem(Item) and in the ItemManager.DeleteItem(Item) with a call to UnregisterItem(Item).

The configuration of the actual access for each item is performed via standard Administration UI - no plugin development is required here.

Checking for application level security access must be done entirely by the plug-in, where relevant. SecurityAccess.CheckPermission is called for getting valid action for the Plug-in.

Checking for access to Items should be done in the ItemManager for maintenance actions, e.g. create/delete/view, but could be used other places if specific actions are defined.

Member Function Documentation

◆ BuildPermissionList() [1/3]

static List< Item > VideoOS.Platform.Util.SecurityAccess.BuildPermissionList ( List< Item > items,
string actionId )
inlinestatic

Check authorization for a list of Items. The items the current user can access with defined action is returned.

Parameters
items
actionId
Returns
Authorized list

◆ BuildPermissionList() [2/3]

static List< Item > VideoOS.Platform.Util.SecurityAccess.BuildPermissionList ( List< Item > items,
string actionId,
ServerId serverId )
inlinestatic

Check authorization for a list of Items. The items the current user can access with defined action is returned.

Parameters
items
actionId
serverId
Returns
Authorized list

◆ BuildPermissionList() [3/3]

static List< Item > VideoOS.Platform.Util.SecurityAccess.BuildPermissionList ( List< Item > items,
string actionId,
string SID,
List< string > groups )
inlinestatic

Check authorization for a list of Items. The items the specified user can access with defined action is returned.

Parameters
items
actionId
SID
groupsUnused, kept to be backwards compatible
Returns
Authorized list

◆ CheckPermission() [1/10]

static void VideoOS.Platform.Util.SecurityAccess.CheckPermission ( Guid pluginDefinitionId,
string actionId )
inlinestatic

This method will check if current user can perform the requested action on this Plugin. Will throw Exception if access is denied.

Parameters
pluginDefinitionId
actionId

◆ CheckPermission() [2/10]

static void VideoOS.Platform.Util.SecurityAccess.CheckPermission ( Guid pluginDefinitionId,
string actionId,
ServerId serverId )
inlinestatic

This method will check if current user can perform the requested action on this Plug-in, when working on items from a given server. Will throw Exception if access is denied.

Parameters
pluginDefinitionId
actionId
serverId

◆ CheckPermission() [3/10]

static void VideoOS.Platform.Util.SecurityAccess.CheckPermission ( Guid pluginDefinitionId,
string actionId,
string SID )
inlinestatic

This method will check if current user can perform the requested action on this Plug-in. Will throw Exception if access is denied.

Parameters
pluginDefinitionId
actionId
SIDThe SID or Guid when basic user. Must be uppercase.

◆ CheckPermission() [4/10]

static void VideoOS.Platform.Util.SecurityAccess.CheckPermission ( Guid pluginDefinitionId,
string actionId,
string SID,
List< string > groups )
inlinestatic

This method will check if current user can perform the requested action on this Plug-in. Will throw Exception if access is denied.

Parameters
pluginDefinitionId
actionId
SIDThe SID og Guid identifying the user. Guid used for basic users, must be uppercase.
groupsUnused, kept to be backwards compatible

◆ CheckPermission() [5/10]

static void VideoOS.Platform.Util.SecurityAccess.CheckPermission ( Item item,
string actionId )
inlinestatic

This method will check if current user can perform the requested action on this Item. Will throw Exception if access is denied.

Parameters
item
actionId


◆ CheckPermission() [6/10]

static void VideoOS.Platform.Util.SecurityAccess.CheckPermission ( Item item,
string actionId,
ServerId serverId )
inlinestatic

This method will check if current user can perform the requested action on this Item. Will throw Exception if access is denied.

Parameters
item
actionId


Parameters
serverId

◆ CheckPermission() [7/10]

static void VideoOS.Platform.Util.SecurityAccess.CheckPermission ( Item item,
string actionId,
string SID )
inlinestatic

This method will check if current user can perform the requested action on this Item. Will throw Exception if access is denied. The user to check is identified by the SID.

Parameters
item
actionId


Parameters
SIDA SID or Guid. The string should be uppercase.

◆ CheckPermission() [8/10]

static void VideoOS.Platform.Util.SecurityAccess.CheckPermission ( Item item,
string actionId,
string SID,
List< string > groups )
inlinestatic

This method will check if current user can perform the requested action on this Item. Will throw Exception if access is denied. The user to check is identified by the SID.

Parameters
item
actionId


Parameters
SIDSID or Guid (for basic users). This must be uppercased.
groupsUnused, kept to be backwards compatible

◆ CheckPermission() [9/10]

static void VideoOS.Platform.Util.SecurityAccess.CheckPermission ( PluginDefinition pluginDefinition,
string actionId )
inlinestatic

This method will check if current user can perform the requested action on this Plug-in. Will throw Exception if access is denied.

Parameters
pluginDefinition
actionId

◆ CheckPermission() [10/10]

static void VideoOS.Platform.Util.SecurityAccess.CheckPermission ( PluginDefinition pluginDefinition,
string actionId,
ServerId serverId )
inlinestatic

This method will check if current user can perform the requested action on this Plug-in. Will throw Exception if access is denied.

Parameters
pluginDefinition
actionId
serverId

◆ Flush()

static void VideoOS.Platform.Util.SecurityAccess.Flush ( )
inlinestatic

For internal use.

◆ GetPermittedActionList() [1/2]

static Collection< String > VideoOS.Platform.Util.SecurityAccess.GetPermittedActionList ( Item item,
String SID )
inlinestatic

Get the permitted action list for a specific user working with specific Item.

Parameters
item
SIDSID or Guid for the user. Must be uppercase.
Returns

◆ GetPermittedActionList() [2/2]

static Collection< String > VideoOS.Platform.Util.SecurityAccess.GetPermittedActionList ( Item item,
String SID,
ServerId serverId )
inlinestatic

Get the permitted action list for a specific user working with specific Item on a specific Server.

Parameters
item
SID
serverId
Returns

◆ GetUserIdentificationViaSid()

static UserIdentification VideoOS.Platform.Util.SecurityAccess.GetUserIdentificationViaSid ( String sid,
LoginSettings loginSettings )
inlinestatic

Get hold of information about an AD user, or a basic user.

Parameters
sid
loginSettings
Returns

◆ HasOverallPermission()

static bool VideoOS.Platform.Util.SecurityAccess.HasOverallPermission ( ServerId serverId,
string securityNamespaceName,
string securityAction )
inlinestatic

Check to see if current user has permission on an overall area.

Parameters
serverId
securityNamespaceNameIs usually a Guid, camera is "623D03F8-C5D5-46BC-A2F4-4C03562D4F85"
securityActionThe action id that is changed for permission
Returns

◆ IsClientAllowed()

static bool VideoOS.Platform.Util.SecurityAccess.IsClientAllowed ( ServerId serverId,
string clientType )
inlinestatic

Can be used to check if a given client type is allowed to connect to the VMS server.

The Environment is using this during login

clientType can be:

  • "SmartClient"
  • "MobileClient"
  • "WebClient"

Supported from Corporate/Expert 2017 R1

When connected to older versions, false will be returned.

Parameters
serverId
clientType
Returns

◆ IsMember()

static bool VideoOS.Platform.Util.SecurityAccess.IsMember ( ServerId serverId,
string sidIdentity,
string roleId )
inlinestatic

This method will check if the user identified by the provided identity is part of a specific role.

RoleId for administrator is:

Parameters
serverIdServer on which the role exists
sidIdentityIdentity of the user to check
roleIdThe role to check

◆ Logoff()

static void VideoOS.Platform.Util.SecurityAccess.Logoff ( )
inlinestatic

Is called internally when the user logs off.

◆ Logout()

static void VideoOS.Platform.Util.SecurityAccess.Logout ( LoginSettings loginSettings)
inlinestatic

Called when one user logs out.

Parameters
loginSettings

◆ RegisterItem()

static void VideoOS.Platform.Util.SecurityAccess.RegisterItem ( Item item)
inlinestatic

When a new Item is created and is under security check, this method need to be called.

Parameters
item

◆ Reload()

static void VideoOS.Platform.Util.SecurityAccess.Reload ( )
inlinestatic

For internal use.

◆ Save()

static void VideoOS.Platform.Util.SecurityAccess.Save ( )
inlinestatic

For internal use.

◆ UnregisterItem()

static void VideoOS.Platform.Util.SecurityAccess.UnregisterItem ( Item item)
inlinestatic

When an Item is being deleted, this method need to be called.

Parameters
item

Member Data Documentation

◆ AdministratorRoleId

readonly Guid VideoOS.Platform.Util.SecurityAccess.AdministratorRoleId = new Guid("1f30d14b-ba91-4e8a-8838-eda17931f8fc")
static

Identify the administrator role.