From a6150c487e7a0eb3fb1d9874d2fa7de61cdbfd30 Mon Sep 17 00:00:00 2001 From: crupest Date: Tue, 27 Apr 2021 19:29:20 +0800 Subject: refactor: ... --- .../Services/User/IUserPermissionService.cs | 35 ++++++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100644 BackEnd/Timeline/Services/User/IUserPermissionService.cs (limited to 'BackEnd/Timeline/Services/User/IUserPermissionService.cs') diff --git a/BackEnd/Timeline/Services/User/IUserPermissionService.cs b/BackEnd/Timeline/Services/User/IUserPermissionService.cs new file mode 100644 index 00000000..7ff1275b --- /dev/null +++ b/BackEnd/Timeline/Services/User/IUserPermissionService.cs @@ -0,0 +1,35 @@ +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); + } +} -- cgit v1.2.3