This Method is used to add a Role to the RoleSet Object.

The combination of the NamespaceUri and RoleName parameters are used to construct the BrowseName for the new Node. The BrowseName shall be unique within the RoleSet Object.

If the optional Properties EndpointsExclude and ApplicationsExclude are available on the Role Object created with this Method, the initial values of the EndpointsExclude and ApplicationsExclude Properties shall be TRUE.

The Client shall use an encrypted channel and shall provide user credentials with administrator rights like SecurityAdmin Role when invoking this Method on the Server.

OPC 10000-3 defines well-known Roles. If this Method is used to add a well-known Role, the name of the Role from OPC 10000-3 is used together with the OPC UA namespace URI. The Server shall use the NodeIds for the well-known Roles in this case. The NodeIds for the well-known Roles are defined in OPC 10000-6.


AddRole (

[in]String RoleName,

[in]String NamespaceUri,

[out]NodeId RoleNodeId





The name of the Role.


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


The NodeId assigned by the Server to the new Node.

Method Result Codes




The RoleName or NamespaceUri is not valid.

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


The Server does not allow more Roles to be added.


The caller does not have the necessary Permissions.


The Role already exists in the Server.


The Server does not have enough resources to add the role.