auto.bus_api/Server/Services/ISessionUserService.cs
cuqmbr e9af067dfa feat: add imperative resource-based authorization
I decided not to make authorization requirements and handlers for each and every resource because the validation logic is pretty similar
2023-05-22 15:27:11 +03:00

15 lines
484 B
C#

namespace Server.Services;
public interface ISessionUserService
{
public string GetAuthUserId();
public string GetAuthUserRole();
public Task<(bool isCompanyOwner, int companyId)> IsAuthUserCompanyOwner();
public Task<bool> IsAuthUserCompanyVehicle(int vehicleId);
public Task<bool> IsAuthUserCompanyVehicleEnrollment(int enrollmentId);
public Task<bool> IsAuthUserCompanyDriver(string driverId);
public Task<bool> IsAuthUserReview(int reviewId);
}