Ejemplo n.º 1
0
        GetPaginatedUserHistoryAsync(int userId,
                                     int skip,
                                     int take)
        {
            int requestedByUserId = GetActiveUserId();

            if (requestedByUserId == userId ||
                HasPermission(Permission.ViewParticipantDetails))
            {
                return(new DataWithCount <IEnumerable <UserLog> >
                {
                    Data = await _userLogRepository.PageHistoryAsync(userId, skip, take),
                    Count = await _userLogRepository.GetHistoryItemCountAsync(userId)
                });
            }
            else
            {
                _logger.LogError($"User {requestedByUserId} doesn't have permission to view details for {userId}.");
                throw new GraException("Permission denied.");
            }
        }