public async Task <List <IPage> > GetAllPages(string projectId, CancellationToken cancellationToken = default(CancellationToken))
 {
     return(await _pageQueries.GetAllPages(
                projectId,
                cancellationToken)
            .ConfigureAwait(false));
 }
Example #2
0
        public async Task <List <IPage> > GetAllPages(
            string projectId,
            string userName,
            string password)
        {
            var permission = await security.ValidatePermissions(
                projectId,
                userName,
                password,
                CancellationToken
                ).ConfigureAwait(false);

            if (!permission.CanEditPosts)
            {
                return(new List <IPage>()); // empty
            }

            return(await pageQueries.GetAllPages(
                       projectId,
                       CancellationToken)
                   .ConfigureAwait(false));
        }