{"action":"created","issue":{"url":"https://api.github.com/repos/pimcore/pimcore/issues/524","repository_url":"https://api.github.com/repos/pimcore/pimcore","labels_url":"https://api.github.com/repos/pimcore/pimcore/issues/524/labels{/name}","comments_url":"https://api.github.com/repos/pimcore/pimcore/issues/524/comments","events_url":"https://api.github.com/repos/pimcore/pimcore/issues/524/events","html_url":"https://github.com/pimcore/pimcore/issues/524","id":143722192,"number":524,"title":"allow dynamic pimcoreNavigation manipulation","user":{"login":"solverat","id":700119,"avatar_url":"https://avatars.githubusercontent.com/u/700119?v=3","gravatar_id":"","url":"https://api.github.com/users/solverat","html_url":"https://github.com/solverat","followers_url":"https://api.github.com/users/solverat/followers","following_url":"https://api.github.com/users/solverat/following{/other_user}","gists_url":"https://api.github.com/users/solverat/gists{/gist_id}","starred_url":"https://api.github.com/users/solverat/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/solverat/subscriptions","organizations_url":"https://api.github.com/users/solverat/orgs","repos_url":"https://api.github.com/users/solverat/repos","events_url":"https://api.github.com/users/solverat/events{/privacy}","received_events_url":"https://api.github.com/users/solverat/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":6,"created_at":"2016-03-26T15:58:03Z","updated_at":"2016-04-08T09:26:13Z","closed_at":"2016-04-08T09:26:13Z","body":"I'm currently developing a plugin which dynamically needs to enable or disable some menu elements because of user role restrictions. \r\n\r\n**my first approach** was to extend the `Pimcore\\Model\\Document\\Page` with the *classmap* functionality. with that custom class i'll override the `getProperty()` method and return the \"navigation_exclude\" property with true or false - depending on the restriction. \r\nthe problem: this will work only for the first call, before the whole navigation tree gets cached by pimcore. \r\n\r\n**my second approach, which needs some improvements from your side:**\r\nIn `Pimcore\\View\\Helper\\PimcoreNavigationController` the navigation will be loaded with \r\n`$navigation = CacheManager::load($cacheKey);` (line 70)\r\nafter that, pimcore is looking for the active page(s). it would be great if we could fetch the navigation after the cache load.\r\n\r\nfor an example we could add this after line 85:\r\n\r\n```\r\n$navHook = \\Pimcore::getEventManager()->trigger(\"navigation.postBuild\", $navigation);\r\n\r\nif ($navHook->stopped()) {\r\n   $navigation = $result->last();\r\n}\r\n``` \r\nwhat do you think? do i miss something? but i think it's not possible to manipulate the navigation dynamically in a different way with the currently given environment."},"comment":{"url":"https://api.github.com/repos/pimcore/pimcore/issues/comments/207346500","html_url":"https://github.com/pimcore/pimcore/issues/524#issuecomment-207346500","issue_url":"https://api.github.com/repos/pimcore/pimcore/issues/524","id":207346500,"user":{"login":"solverat","id":700119,"avatar_url":"https://avatars.githubusercontent.com/u/700119?v=3","gravatar_id":"","url":"https://api.github.com/users/solverat","html_url":"https://github.com/solverat","followers_url":"https://api.github.com/users/solverat/followers","following_url":"https://api.github.com/users/solverat/following{/other_user}","gists_url":"https://api.github.com/users/solverat/gists{/gist_id}","starred_url":"https://api.github.com/users/solverat/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/solverat/subscriptions","organizations_url":"https://api.github.com/users/solverat/orgs","repos_url":"https://api.github.com/users/solverat/repos","events_url":"https://api.github.com/users/solverat/events{/privacy}","received_events_url":"https://api.github.com/users/solverat/received_events","type":"User","site_admin":false},"created_at":"2016-04-08T09:26:13Z","updated_at":"2016-04-08T09:26:13Z","body":"dammit, i totally missed that. That should work, thanks for the hint!"}}