[HttpGet("{token}/{id}")] ///{currentWorkspace}")] public JsonResult GetPage(string token, int id) //, int currentWorkspace) { var page = _repo.GetPage(id); if (page == null) { throw new TedExeption(ExceptionCodes.PageNotFound); } if (!page.isPublic) { if (_auth.AuthenticateForWorkspace(token, page.WorkspaceId) == null) { throw new TedExeption(ExceptionCodes.Authentication); } } // Load tree ICollection <Page> tree = null; //if (page.WorkspaceId!=currentWorkspace && !page.isPublic) if (!page.isPublic) { tree = _repo.GetNavigationTree(page.WorkspaceId); } // Avoid cyclic refs page.workspace.pages = null; return(Json(new { success = true, data = page, tree })); }