aboutsummaryrefslogtreecommitdiff
path: root/Jellyfin.Data/IHasPermissions.cs
blob: 3be72259ad1c2d03a575ed4492a19676f1c27731 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
using System.Collections.Generic;
using Jellyfin.Data.Entities;
using Jellyfin.Data.Enums;

namespace Jellyfin.Data
{
    /// <summary>
    /// An abstraction representing an entity that has permissions.
    /// </summary>
    public interface IHasPermissions
    {
        /// <summary>
        /// Gets a collection containing this entity's permissions.
        /// </summary>
        ICollection<Permission> Permissions { get; }

        /// <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);
    }
}