using System.Threading.Tasks; namespace Timeline.Services.User { public interface IUserPermissionService { /// /// Get permissions of a user. /// /// The id of the user. /// Whether check the user's existence. /// The permission list. /// Thrown when is true and user does not exist. Task GetPermissionsOfUserAsync(long userId, bool checkUserExistence = true); /// /// Add a permission to user. /// /// The id of the user. /// The new permission. /// Thrown when user does not exist. /// Thrown when change root user's permission. Task AddPermissionToUserAsync(long userId, UserPermission permission); /// /// Remove a permission from user. /// /// The id of the user. /// The permission. /// Whether check the user's existence. /// Thrown when is true and user does not exist. /// Thrown when change root user's permission. Task RemovePermissionFromUserAsync(long userId, UserPermission permission, bool checkUserExistence = true); } }