Difference between RolePermissions and UserRolePermissions|OPC UA Standard|Forum|OPC Foundation

Avatar
Search
Forum Scope


Match



Forum Options



Minimum search word length is 3 characters - maximum search word length is 84 characters
Lost password?
sp_Feed sp_PrintTopic sp_TopicIcon
Difference between RolePermissions and UserRolePermissions
Avatar
Ander Zubizarreta
Member
Members
Forum Posts: 4
Member Since:
12/01/2020
sp_UserOfflineSmall Offline
1
03/22/2021 - 03:45
sp_Permalink sp_Print

Hello,

I'm implementing an OPC-UA server and I'm using the RolePermissions for authorization. However I'm not sure if I should also user UserRolePermissions, since from the OPC UA Reference I don't get to understand the specifics about it.

Could someone tell the difference between RolePermissions and UserRolePermissions?

Thanks

Avatar
Randy Armstrong
Admin
Forum Posts: 1451
Member Since:
05/30/2017
sp_UserOfflineSmall Offline
2
03/23/2021 - 00:10
sp_Permalink sp_Print

https://reference.opcfoundatio.....rt3/5.2.9/

The optional RolePermissions Attribute specifies the Permissions that apply to a Node for all Roles which have access to the Node.

https://reference.opcfoundatio.....t3/5.2.10/

The optional UserRolePermissions Attribute specifies the Permissions that apply to a Node for all Roles granted to current Session.

The naming pattern where the prefix "User" is used to provide information that is specific to the current Session is used in other places such as AccessLevel and UserAccessLevel.

Avatar
Ander Zubizarreta
Member
Members
Forum Posts: 4
Member Since:
12/01/2020
sp_UserOfflineSmall Offline
3
03/23/2021 - 02:27
sp_Permalink sp_Print

Hello Randy,

Thank you for your answer. I'm sorry but I still don't get to understand when and how UserRolePermissions should be used. 

When a users logs-in on my server I grant the UserIdentity object with a specific role, for example:

IUserIdentity ui = new UserIdentity(userNameToken);

ui.GrantedRoleIds.Add(ObjectIds.WellKnownRole_ConfigureAdmin);

Then I use RolePermissions property of the nodes to specify the permissions, and see that the user can access  depending of permissions set in RolePermissions property.

Which is the case where UserRolePermissions should be used? An example would be helpful. I think I'm missunderstanding the concept.

Thanks.

Avatar
Randy Armstrong
Admin
Forum Posts: 1451
Member Since:
05/30/2017
sp_UserOfflineSmall Offline
4
03/23/2021 - 18:44
sp_Permalink sp_Print

For each node you need to calculate the subset of RolePermissions for the Node that is available to the current Session and return that array in UserRolePermissions. The attribute is read only.

Forum Timezone: America/Phoenix
Most Users Ever Online: 510
Currently Online:
Guest(s) 48
Currently Browsing this Page:
1 Guest(s)
Top Posters:
Forum Stats:
Groups: 2
Forums: 10
Topics: 1348
Posts: 4576