{"action":"created","issue":{"url":"https://api.github.com/repos/Adobe-Consulting-Services/acs-aem-commons/issues/1252","repository_url":"https://api.github.com/repos/Adobe-Consulting-Services/acs-aem-commons","labels_url":"https://api.github.com/repos/Adobe-Consulting-Services/acs-aem-commons/issues/1252/labels{/name}","comments_url":"https://api.github.com/repos/Adobe-Consulting-Services/acs-aem-commons/issues/1252/comments","events_url":"https://api.github.com/repos/Adobe-Consulting-Services/acs-aem-commons/issues/1252/events","html_url":"https://github.com/Adobe-Consulting-Services/acs-aem-commons/issues/1252","id":296802143,"number":1252,"title":"Error Pages with CUG doesn't honor root page with errorpages defined","user":{"login":"jamiecounsell","id":2321599,"avatar_url":"https://avatars3.githubusercontent.com/u/2321599?v=4","gravatar_id":"","url":"https://api.github.com/users/jamiecounsell","html_url":"https://github.com/jamiecounsell","followers_url":"https://api.github.com/users/jamiecounsell/followers","following_url":"https://api.github.com/users/jamiecounsell/following{/other_user}","gists_url":"https://api.github.com/users/jamiecounsell/gists{/gist_id}","starred_url":"https://api.github.com/users/jamiecounsell/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jamiecounsell/subscriptions","organizations_url":"https://api.github.com/users/jamiecounsell/orgs","repos_url":"https://api.github.com/users/jamiecounsell/repos","events_url":"https://api.github.com/users/jamiecounsell/events{/privacy}","received_events_url":"https://api.github.com/users/jamiecounsell/received_events","type":"User","site_admin":false},"labels":[{"id":59394029,"url":"https://api.github.com/repos/Adobe-Consulting-Services/acs-aem-commons/labels/bug","name":"bug","color":"fc2929","default":true}],"state":"open","locked":false,"assignee":{"login":"davidjgonzalez","id":1451868,"avatar_url":"https://avatars3.githubusercontent.com/u/1451868?v=4","gravatar_id":"","url":"https://api.github.com/users/davidjgonzalez","html_url":"https://github.com/davidjgonzalez","followers_url":"https://api.github.com/users/davidjgonzalez/followers","following_url":"https://api.github.com/users/davidjgonzalez/following{/other_user}","gists_url":"https://api.github.com/users/davidjgonzalez/gists{/gist_id}","starred_url":"https://api.github.com/users/davidjgonzalez/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/davidjgonzalez/subscriptions","organizations_url":"https://api.github.com/users/davidjgonzalez/orgs","repos_url":"https://api.github.com/users/davidjgonzalez/repos","events_url":"https://api.github.com/users/davidjgonzalez/events{/privacy}","received_events_url":"https://api.github.com/users/davidjgonzalez/received_events","type":"User","site_admin":false},"assignees":[{"login":"davidjgonzalez","id":1451868,"avatar_url":"https://avatars3.githubusercontent.com/u/1451868?v=4","gravatar_id":"","url":"https://api.github.com/users/davidjgonzalez","html_url":"https://github.com/davidjgonzalez","followers_url":"https://api.github.com/users/davidjgonzalez/followers","following_url":"https://api.github.com/users/davidjgonzalez/following{/other_user}","gists_url":"https://api.github.com/users/davidjgonzalez/gists{/gist_id}","starred_url":"https://api.github.com/users/davidjgonzalez/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/davidjgonzalez/subscriptions","organizations_url":"https://api.github.com/users/davidjgonzalez/orgs","repos_url":"https://api.github.com/users/davidjgonzalez/repos","events_url":"https://api.github.com/users/davidjgonzalez/events{/privacy}","received_events_url":"https://api.github.com/users/davidjgonzalez/received_events","type":"User","site_admin":false}],"milestone":null,"comments":4,"created_at":"2018-02-13T16:31:22Z","updated_at":"2018-05-29T18:56:52Z","closed_at":null,"author_association":"NONE","body":"* AEM version: 6.3, SP2 CFP\r\n* AEM ACS v3.13.0\r\n* Reproducible on latest: YES\r\n\r\n### Expected Behavior\r\n\r\nI have a site that is entirely behind SAML authentication, and a subset of the pages on the site need to be restricted by the user's group.\r\n\r\nWhen using the ErrorPageHandler with AEM Closed User Groups, I would expect to be able to arrange the following structure:\r\n\r\n![untitled drawing](https://user-images.githubusercontent.com/2321599/36158911-7b3e2f08-10ab-11e8-8990-4e53398a1a79.jpg)\r\n\r\nBy default, a page restricted by CUGs returns a 404 (to avoid exposing the existence of a page at that location), so I should be able to use the 404 page to display to users who are unable to see those sections. This means the 404 page needs to be customized to say \"you can't see this content\", which means I can't set the errorpages property on the Site Root, as I don't want legitimate 404s being caught by this.\r\n\r\n### Actual Behavior\r\n\r\nWhen a user who does not have access to Private Page 1 tries to access it, it gets a 404. However, the \"first real parent\" detected is the _parent_ page of the page I expect it to find looking for with the errorpages defined. This is because the ErrorPageHandlerImpl will start at the erroring page and crawl upward in the page tree. It skips the CUG root because it uses `resourceResolver.resolve(request, candidatePath)` which I believe will attempt to use the requesting user authorizable to retrieve the page. If the root page is protected using CUG, then the user does not have access and it will continue up the tree to the Site Root. \r\n\r\nAs a result, I've created the following structure:\r\n\r\n![untitled drawing 2](https://user-images.githubusercontent.com/2321599/36161072-c1ea3a64-10b0-11e8-8f8b-8c1fffffb102.jpg)\r\n\r\nThis is not ideal, since we have to define the closed user group setting multiple times (or have yet another parent page to wrap the child pages) and it leaves us with this page that everyone can access. \r\n\r\nWhat I've done is set a redirect on Private Root to the homepage, so no user will _see_ that page. This works, but is not ideal\r\n\r\n### Possible Resolution\r\n\r\nWhen crawling up the page tree looking for a new root page, check if (in order)\r\n- The page exists (if not, continue, if yes, next step)\r\n- The page has errorpages set (if yes, return, if no, next step)\r\n- The user has access to the page (if not, continue, if yes, return)\r\n\r\n### Steps to Reproduce\r\n\r\n- Create the following page structure above (with error pages and CUGs configured)\r\n- Attempt to reach a private page with a user who does not have access\r\n- Receive default 404 error\r\n"},"comment":{"url":"https://api.github.com/repos/Adobe-Consulting-Services/acs-aem-commons/issues/comments/392898443","html_url":"https://github.com/Adobe-Consulting-Services/acs-aem-commons/issues/1252#issuecomment-392898443","issue_url":"https://api.github.com/repos/Adobe-Consulting-Services/acs-aem-commons/issues/1252","id":392898443,"user":{"login":"stale[bot]","id":26384082,"avatar_url":"https://avatars3.githubusercontent.com/in/1724?v=4","gravatar_id":"","url":"https://api.github.com/users/stale%5Bbot%5D","html_url":"https://github.com/apps/stale","followers_url":"https://api.github.com/users/stale%5Bbot%5D/followers","following_url":"https://api.github.com/users/stale%5Bbot%5D/following{/other_user}","gists_url":"https://api.github.com/users/stale%5Bbot%5D/gists{/gist_id}","starred_url":"https://api.github.com/users/stale%5Bbot%5D/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/stale%5Bbot%5D/subscriptions","organizations_url":"https://api.github.com/users/stale%5Bbot%5D/orgs","repos_url":"https://api.github.com/users/stale%5Bbot%5D/repos","events_url":"https://api.github.com/users/stale%5Bbot%5D/events{/privacy}","received_events_url":"https://api.github.com/users/stale%5Bbot%5D/received_events","type":"Bot","site_admin":false},"created_at":"2018-05-29T18:56:52Z","updated_at":"2018-05-29T18:56:52Z","author_association":"NONE","body":"This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.\n"}}
{"actor":{"display_login":"stale"}}