public void VerifyAccessOrThrow(SingleEntityDapperResult result, UserDto currentUser, UserOperation operation) { if (!result.Authorized) { throw AuthExceptionFactory.CreateForbiddenException(currentUser, result.StudyId, operation); } }
void VerifyAccessOrThrow(UserDto currentUser, IHasStudyPermissionDetails studyPermissionDetails, UserOperation operation, string roleBeingAddedOrRemoved = null) { if (!HasAccessToOperationForStudy(currentUser, studyPermissionDetails, operation, roleBeingAddedOrRemoved)) { throw AuthExceptionFactory.CreateForbiddenException(currentUser, studyPermissionDetails, operation); } }