mirror of
https://github.com/OPCFoundation/UA-.NETStandard.git
synced 2026-10-18 22:55:08 +08:00
7824e6fdeb
* Enhance role-based access control and add permission tests - Improve ValidateRolePermissions logic and add ILogger support for detailed access denial logging - Expand default roles (add AuthenticatedUser, TrustedApplication) - Refine RoleBasedIdentity to merge roles and avoid duplicates - Set UserIdentity default GrantedRoleIds to Anonymous - Fix MasterNodeManager PrepareValidationCache - Add comprehensive unit tests for role permission validation and logging * Fix GDS self-admin role: restore NodeId.Null in GrantedRoleIds for ApplicationSelfAdmin The RoleBasedIdentity constructor was filtering out roles with null RoleIds (!role.RoleId.IsNull), which broke the GDS ApplicationSelfAdmin mechanism. The GDS OnAddSelfAdminUserRolePermissions relies on GrantedRoleIds.Contains(NodeId.Null) to detect self-admin users (since GdsRole.ApplicationSelfAdmin has RoleId = ExpandedNodeId.Null). Also remove unused System.Data using statement. Agent-Logs-Url: https://github.com/OPCFoundation/UA-.NETStandard/sessions/3db86efa-c6d6-4e63-947f-156a88210b58 Co-authored-by: romanett <7413710+romanett@users.noreply.github.com> * fix build --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: romanett <7413710+romanett@users.noreply.github.com>
51 lines
2.1 KiB
C#
51 lines
2.1 KiB
C#
/* ========================================================================
|
|
* Copyright (c) 2005-2025 The OPC Foundation, Inc. All rights reserved.
|
|
*
|
|
* OPC Foundation MIT License 1.00
|
|
*
|
|
* Permission is hereby granted, free of charge, to any person
|
|
* obtaining a copy of this software and associated documentation
|
|
* files (the "Software"), to deal in the Software without
|
|
* restriction, including without limitation the rights to use,
|
|
* copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
* copies of the Software, and to permit persons to whom the
|
|
* Software is furnished to do so, subject to the following
|
|
* conditions:
|
|
*
|
|
* The above copyright notice and this permission notice shall be
|
|
* included in all copies or substantial portions of the Software.
|
|
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
|
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
|
|
* OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
|
* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
|
|
* HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
|
|
* WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
|
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
|
|
* OTHER DEALINGS IN THE SOFTWARE.
|
|
*
|
|
* The complete license agreement can be found here:
|
|
* http://opcfoundation.org/License/MIT/1.00/
|
|
* ======================================================================*/
|
|
|
|
#if !NET9_0_OR_GREATER
|
|
#endif
|
|
|
|
namespace Opc.Ua.Server
|
|
{
|
|
/// <summary>
|
|
/// Privileged identity which can access the system configuration.
|
|
/// </summary>
|
|
public class SystemConfigurationIdentity : RoleBasedIdentity
|
|
{
|
|
/// <summary>
|
|
/// Create a user identity with the privilege
|
|
/// to modify the system configuration.
|
|
/// </summary>
|
|
/// <param name="identity">The user identity.</param>
|
|
public SystemConfigurationIdentity(IUserIdentity identity)
|
|
: base(identity, [Role.SecurityAdmin, Role.ConfigureAdmin, Role.AuthenticatedUser], new NamespaceTable())
|
|
{
|
|
}
|
|
}
|
|
}
|