/// <summary>
        ///     Lists access rights.
        /// </summary>
        /// <param name="context">The context.</param>
        /// <returns></returns>
        public Task Consume(ConsumeContext <IListAccessRights> context)
        {
            var accessPointFetcher = RoleBasedDataFetcher.Create(
                _databaseContext.AccessPoints.GetAll,
                manager => _databaseContext.AccessPoints.Filter(x => x.ManagedBy == manager));
            var accessPoints   = accessPointFetcher.Execute();
            var accessPointIds = accessPoints.Select(x => x.AccessPointId).ToArray();
            var accessRights   = _databaseContext.AccessRights.Filter(x => x.AccessRules.Any(rule => accessPointIds.Contains(rule.AccessPoint.AccessPointId)));

            var visitor = new ConvertAccessRightsVisitor();

            accessRights.ForEach(x => x.Accept(visitor));
            return(context.RespondAsync(ListCommand.AccessRightsResult(visitor.UserAccessRightsDto.ToArray(), visitor.UserGroupAccessRightsDto.ToArray())));
        }