예제 #1
0
        GetPaginatedUserDrawingListAsync(int userId,
                                         int skip,
                                         int take)
        {
            int authUserId = GetClaimId(ClaimType.UserId);

            if (HasPermission(Permission.ViewUserDrawings))
            {
                return(new DataWithCount <IEnumerable <DrawingWinner> >
                {
                    Data = await _drawingRepository.PageUserAsync(userId, skip, take),
                    Count = await _drawingRepository.GetUserWinCountAsync(userId)
                });
            }
            else
            {
                _logger.LogError($"User {authUserId} doesn't have permission to view drawinsg for {userId}.");
                throw new GraException("Permission denied.");
            }
        }