Exemple #1
0
        public async Task <ActionResult> EditElement(int plotelementid, int plotFolderId, int projectId)
        {
            var folder = await _plotRepository.GetPlotFolderAsync(projectId, plotFolderId);

            if (folder == null)
            {
                return(HttpNotFound());
            }
            var viewModel = new EditPlotElementViewModel(folder.Elements.Single(e => e.PlotElementId == plotelementid),
                                                         folder.HasMasterAccess(CurrentUserId, acl => acl.CanManagePlots));

            return(View(viewModel));
        }
        public async Task <ActionResult> EditElement(int plotelementid, int plotFolderId, int projectId)
        {
            var folder = await _plotRepository.GetPlotFolderAsync(projectId, plotFolderId);

            var error = AsMaster(folder, acl => acl.CanManagePlots);

            if (error != null)
            {
                return(error);
            }

            var viewModel = new EditPlotElementViewModel(folder.Elements.Single(e => e.PlotElementId == plotelementid));

            return(View(viewModel));
        }