jellyfin-server/Jellyfin.Data/Interfaces/IHasPermissions.cs

32 lines
1.1 KiB
C#
Raw Normal View History

2020-05-15 21:24:01 +00:00
using System.Collections.Generic;
using Jellyfin.Data.Entities;
2020-05-31 00:49:31 +00:00
using Jellyfin.Data.Enums;
2020-05-15 21:24:01 +00:00
namespace Jellyfin.Data.Interfaces
2020-05-15 21:24:01 +00:00
{
2020-05-31 00:49:31 +00:00
/// <summary>
/// An abstraction representing an entity that has permissions.
/// </summary>
2020-05-15 21:24:01 +00:00
public interface IHasPermissions
{
2020-05-31 00:49:31 +00:00
/// <summary>
/// Gets a collection containing this entity's permissions.
/// </summary>
2020-05-15 21:24:01 +00:00
ICollection<Permission> Permissions { get; }
2020-05-31 00:49:31 +00:00
/// <summary>
/// Checks whether this entity has the specified permission kind.
/// </summary>
/// <param name="kind">The kind of permission.</param>
/// <returns><c>true</c> if this entity has the specified permission, <c>false</c> otherwise.</returns>
bool HasPermission(PermissionKind kind);
/// <summary>
/// Sets the specified permission to the provided value.
/// </summary>
/// <param name="kind">The kind of permission.</param>
/// <param name="value">The value to set.</param>
void SetPermission(PermissionKind kind, bool value);
2020-05-15 21:24:01 +00:00
}
}