I decided not to make authorization requirements and handlers for each and every resource because the validation logic is pretty similar
15 lines
484 B
C#
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);
|
|
} |