SecurityDescriptorScopeAttribute.cs 474 B

1234567891011121314151617181920
  1. using System;
  2. using System.Linq;
  3. namespace InABox.Core
  4. {
  5. public class SecurityDescriptorScopeAttribute : Attribute
  6. {
  7. public SecurityDescriptorScopeAttribute(params SecurityDescriptorScope[] scopes)
  8. {
  9. Scopes = scopes;
  10. }
  11. public SecurityDescriptorScope[] Scopes { get; }
  12. public bool HasScope(SecurityDescriptorScope scope)
  13. {
  14. return Scopes != null && Scopes.Contains(scope);
  15. }
  16. }
  17. }