This Methodis used to add a Role to the RoleSet Object.

The combination of the NamespaceUri andRoleNameparameters are used to construct the BrowseNamefor the new Node. The BrowseName shall be unique within the RoleSet Object.

If the optional Properties EndpointsExcludeand ApplicationsExcludeare available on the Role Objectcreated with this Method, the initial values of the EndpointsExcludeand ApplicationsExcludeProperties shall be TRUE.

This Methodaffects security and shall only be browseable and callable by authorized administrators.

OPC 10000-3defines well-known Roles. If this Methodis used to add a well-known Role, the name of the Rolefrom OPC 10000-3is used together with the OPC UA namespace URI. The Servershall use the NodeIdsfor the well-known Rolesin this case. The NodeIdsfor the well-known Rolesare defined in OPC 10000-6.

Signature

AddRole(

[in]String RoleName,

[in]String NamespaceUri,

[out]NodeId RoleNodeId

);

Argument

Description

RoleName

The name of the Role.

NamespaceUri

The NamespaceUriqualifies the RoleName. If this value is null or empty then the resulting BrowseNamewill be qualified by the Server’s NamespaceUri.

RoleNodeId

The NodeIdassigned by the Serverto the new Node.

Method Result Codes

ResultCode

Description

Bad_InvalidArgument

The RoleNameor NamespaceUri is not valid.

The text associated with the error shall indicate the exact problem.

Bad_NotSupported

The Serverdoes not allow more Rolesto be added.

Bad_UserAccessDenied

The caller does not have the necessary Permissions.