示例#1
0
        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);
        }