예제 #1
0
        public async Task <List <Models.DataModels.Board> > LoadTopicBoards(int topicId)
        {
            var messageBoardsQuery = from messageBoard in DbContext.MessageBoards
                                     where messageBoard.MessageId == topicId
                                     select messageBoard.BoardId;

            var boardIds       = messageBoardsQuery.ToList();
            var assignedBoards = (await BoardRepository.Records()).Where(r => boardIds.Contains(r.Id)).ToList();

            if (!await RoleRepository.CanAccessBoards(assignedBoards))
            {
                throw new HttpForbiddenError();
            }

            return(assignedBoards);
        }