public async Task <bool> IsValidWithAccessCheck(string wbsCode, CancellationToken cancellation = default) { var currentUser = await _userService.GetCurrentUserAsync(); OperationAccessUtil.HasAccessToOperationOrThrow(currentUser, UserOperation.Study_Create); return(await IsValid(wbsCode, cancellation)); }
async Task ThrowIfOperationNotAllowed(UserOperation operation) { var currentUser = await _userService.GetCurrentUserAsync(); OperationAccessUtil.HasAccessToOperationOrThrow(currentUser, operation); }