Beispiel #1
0
        GetPaginatedDrawingListAsync(int skip, int take, bool archived)
        {
            int authUserId = GetClaimId(ClaimType.UserId);

            if (HasPermission(Permission.PerformDrawing))
            {
                int siteId = GetCurrentSiteId();
                return(new DataWithCount <IEnumerable <Drawing> >
                {
                    Data = await _drawingRepository.PageAllAsync(siteId, skip, take, archived),
                    Count = await _drawingRepository.GetCountAsync(siteId, archived)
                });
            }
            else
            {
                _logger.LogError($"User {authUserId} doesn't have permission to view all drawings.");
                throw new GraException("Permission denied.");
            }
        }