using System.Collections.Generic; namespace ZB.MOM.WW.OtOpcUa.Host.Domain { /// /// Pluggable interface for validating user credentials. Implement for different backing stores (config file, LDAP, /// etc.). /// public interface IUserAuthenticationProvider { /// /// Validates a username/password combination. /// bool ValidateCredentials(string username, string password); } /// /// Extended interface for providers that can resolve application-level roles for authenticated users. /// When the auth provider implements this interface, OnImpersonateUser uses the returned roles /// to control write and alarm-ack permissions. /// public interface IRoleProvider { /// /// Returns the set of application-level roles granted to the user. /// IReadOnlyList GetUserRoles(string username); } /// /// Well-known application-level role names used for permission enforcement. /// public static class AppRoles { public const string ReadOnly = "ReadOnly"; public const string WriteOperate = "WriteOperate"; public const string WriteTune = "WriteTune"; public const string WriteConfigure = "WriteConfigure"; public const string AlarmAck = "AlarmAck"; } }