IHasPermissions.cs 1.1 KB

12345678910111213141516171819202122232425262728293031
  1. using System.Collections.Generic;
  2. using Jellyfin.Data.Entities;
  3. using Jellyfin.Data.Enums;
  4. namespace Jellyfin.Data.Interfaces
  5. {
  6. /// <summary>
  7. /// An abstraction representing an entity that has permissions.
  8. /// </summary>
  9. public interface IHasPermissions
  10. {
  11. /// <summary>
  12. /// Gets a collection containing this entity's permissions.
  13. /// </summary>
  14. ICollection<Permission> Permissions { get; }
  15. /// <summary>
  16. /// Checks whether this entity has the specified permission kind.
  17. /// </summary>
  18. /// <param name="kind">The kind of permission.</param>
  19. /// <returns><c>true</c> if this entity has the specified permission, <c>false</c> otherwise.</returns>
  20. bool HasPermission(PermissionKind kind);
  21. /// <summary>
  22. /// Sets the specified permission to the provided value.
  23. /// </summary>
  24. /// <param name="kind">The kind of permission.</param>
  25. /// <param name="value">The value to set.</param>
  26. void SetPermission(PermissionKind kind, bool value);
  27. }
  28. }