88 lines
4.2 KiB
C#
88 lines
4.2 KiB
C#
// ***********************************************************************
|
|
// <copyright file="IPermissionService.cs">
|
|
// AgileWebs
|
|
// </copyright>
|
|
// ***********************************************************************
|
|
|
|
using Core.Thalos.BuildingBlocks;
|
|
using Core.Thalos.Domain.Contexts.Onboarding.Request;
|
|
|
|
namespace Core.Thalos.Provider.Contracts
|
|
{
|
|
/// <summary>
|
|
/// Interface for Permission-related service operations.
|
|
/// </summary>
|
|
public interface IPermissionProvider
|
|
{
|
|
/// <summary>
|
|
/// Creates a new Permission.
|
|
/// </summary>
|
|
/// <param name="newPermission">The Permission to be created.</param>
|
|
/// <param name="cancellationToken">A token to cancel the asynchronous operation.</param>
|
|
/// <returns>
|
|
/// A <see cref="ValueTask{PermissionAdapter}"/> representing the asynchronous execution of the service.
|
|
/// </returns>
|
|
ValueTask<PermissionAdapter> CreatePermission(PermissionRequest newPermission, CancellationToken cancellationToken);
|
|
|
|
/// <summary>
|
|
/// Gets a Permission by its identifier.
|
|
/// </summary>
|
|
/// <param name="_id">The Permission Mongo identifier.</param>
|
|
/// <param name="cancellationToken">A token to cancel the asynchronous operation.</param>
|
|
/// <returns>
|
|
/// A <see cref="ValueTask{PermissionAdapter}"/> representing the asynchronous execution of the service.
|
|
/// </returns>
|
|
ValueTask<PermissionAdapter> GetPermissionById(string _id, CancellationToken cancellationToken);
|
|
|
|
/// <summary>
|
|
/// Gets all Permissions.
|
|
/// </summary>
|
|
/// <param name="cancellationToken">A token to cancel the asynchronous operation.</param>
|
|
/// <returns>
|
|
/// A <see cref="ValueTask{IEnumerable{PermissionAdapter}}"/> representing the asynchronous execution of the service.
|
|
/// </returns>
|
|
ValueTask<IEnumerable<PermissionAdapter>> GetAllPermissions(CancellationToken cancellationToken);
|
|
|
|
/// <summary>
|
|
/// Gets all Permissions by a list of identifiers.
|
|
/// </summary>
|
|
/// <param name="permissions">The list of Permission identifiers.</param>
|
|
/// <param name="cancellationToken">A token to cancel the asynchronous operation.</param>
|
|
/// <returns>
|
|
/// A <see cref="ValueTask{IEnumerable{PermissionAdapter}}"/> representing the asynchronous execution of the service.
|
|
/// </returns>
|
|
ValueTask<IEnumerable<PermissionAdapter>> GetAllPermissionsByList(string[] permissions, CancellationToken cancellationToken);
|
|
|
|
/// <summary>
|
|
/// Changes the status of a Permission.
|
|
/// </summary>
|
|
/// <param name="_id">The Permission Mongo identifier.</param>
|
|
/// <param name="newStatus">The new status of the Permission.</param>
|
|
/// <param name="cancellationToken">A token to cancel the asynchronous operation.</param>
|
|
/// <returns>
|
|
/// A <see cref="ValueTask{PermissionAdapter}"/> representing the asynchronous execution of the service.
|
|
/// </returns>
|
|
ValueTask<PermissionAdapter?> ChangePermissionStatus(string _id, Blueprint.Mongo.StatusEnum newStatus, CancellationToken cancellationToken);
|
|
|
|
/// <summary>
|
|
/// Updates a Permission.
|
|
/// </summary>
|
|
/// <param name="entity">The Permission to be updated.</param>
|
|
/// <param name="cancellationToken">A token to cancel the asynchronous operation.</param>
|
|
/// <returns>
|
|
/// A <see cref="ValueTask{PermissionAdapter}"/> representing the asynchronous execution of the service.
|
|
/// </returns>
|
|
ValueTask<PermissionAdapter?> UpdatePermission(PermissionAdapter entity, CancellationToken cancellationToken);
|
|
|
|
/// <summary>
|
|
/// Deletes a Permission by its identifier.
|
|
/// </summary>
|
|
/// <param name="_id">The Permission Mongo identifier.</param>
|
|
/// <param name="cancellationToken">A token to cancel the asynchronous operation.</param>
|
|
/// <returns>
|
|
/// A <see cref="ValueTask{PermissionAdapter}"/> representing the asynchronous execution of the service.
|
|
/// </returns>
|
|
ValueTask<PermissionAdapter?> DeletePermission(string _id, CancellationToken cancellationToken);
|
|
}
|
|
}
|