namespace Connected.Services.Annotations { public enum AuthorizationPolicyBehavior { Mandatory = 1, Optional = 2 } public enum AuthorizationStage { Init = 1, Result = 2 } internal enum EnumOperation { HigherThan = 1, AtLeast = 2, } [AttributeUsage(AttributeTargets.Method, AllowMultiple = true, Inherited = true)] public sealed class ServiceAuthorizationAttribute : Attribute { public ServiceAuthorizationAttribute(params string[] claims) { if (claims.Any()) Claims = new List(claims); } public AuthorizationPolicyBehavior Behavior { get; set; } = AuthorizationPolicyBehavior.Mandatory; public int Priority { get; set; } public AuthorizationStage Stage { get; set; } = AuthorizationStage.Init; public List Claims { get; } } }