{"action":"created","issue":{"url":"https://api.github.com/repos/silverstripe/silverstripe-cms/issues/1529","repository_url":"https://api.github.com/repos/silverstripe/silverstripe-cms","labels_url":"https://api.github.com/repos/silverstripe/silverstripe-cms/issues/1529/labels{/name}","comments_url":"https://api.github.com/repos/silverstripe/silverstripe-cms/issues/1529/comments","events_url":"https://api.github.com/repos/silverstripe/silverstripe-cms/issues/1529/events","html_url":"https://github.com/silverstripe/silverstripe-cms/issues/1529","id":160087945,"number":1529,"title":"On a SiteTree item with canEdit() & canView() both false, right-click to Edit triggers an error","user":{"login":"colintucker","id":1853705,"avatar_url":"https://avatars.githubusercontent.com/u/1853705?v=3","gravatar_id":"","url":"https://api.github.com/users/colintucker","html_url":"https://github.com/colintucker","followers_url":"https://api.github.com/users/colintucker/followers","following_url":"https://api.github.com/users/colintucker/following{/other_user}","gists_url":"https://api.github.com/users/colintucker/gists{/gist_id}","starred_url":"https://api.github.com/users/colintucker/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/colintucker/subscriptions","organizations_url":"https://api.github.com/users/colintucker/orgs","repos_url":"https://api.github.com/users/colintucker/repos","events_url":"https://api.github.com/users/colintucker/events{/privacy}","received_events_url":"https://api.github.com/users/colintucker/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":4,"created_at":"2016-06-14T03:04:47Z","updated_at":"2016-07-07T10:12:08Z","closed_at":null,"body":"Playing with permissions today I noticed that if I have a SiteTree object with both canEdit() and canView() returning false, I can still right-click on the greyed-out item in the tree, and choose \"Edit\" from the context menu.  This will then trigger an error in CMSMain_Content.ss, as it tries to obtain the EditForm, and receives an SS_HTTPResponse object.  Full stack trace provided below:\r\n\r\n<pre>\r\nERROR [Recoverable Error]: Object of class SS_HTTPResponse could not be converted to string\r\nIN GET /admin/pages/edit/show/9\r\nLine 133 in C:\\Windows\\Temp\\path\\user\\.cache.cms.templates.Includes.CMSMain_Content.ss\r\n\r\nSource\r\n======\r\n  124: \t</div>\r\n  125: \r\n  126: \t';\r\n  127: \r\n  128: $val .= $scope->locally()->XML_val('Tools', null, true);\r\n  129: $val .= '\r\n  130: \r\n  131: \t';\r\n  132: \r\n* 133: $val .= $scope->locally()->XML_val('EditForm', null, true);\r\n  134: $val .= '\r\n  135: \r\n  136: </div>\r\n  137: ';\r\n  138: \r\n\r\nTrace\r\n=====\r\ninclude(C:\\Windows\\Temp\\path\\user\\.cache.cms.templates.Includes.CMSMain_Content.ss)\r\nSSViewer.php:1064\r\n\r\nSSViewer->includeGeneratedTemplate(C:\\Windows\\TEMP\\path\\user/.cache.cms.templates.Includes.CMSMain_Content.ss,CMSPageEditController,,Array,)\r\nSSViewer.php:1126\r\n\r\nSSViewer->process(CMSPageEditController,)\r\nViewableData.php:360\r\n\r\nViewableData->renderWith(Array)\r\nLeftAndMain.php:596\r\n\r\nLeftAndMain->{closure}()\r\n\r\ncall_user_func(Closure)\r\nPjaxResponseNegotiator.php:89\r\n\r\nPjaxResponseNegotiator->respond(SS_HTTPRequest)\r\nLeftAndMain.php:579\r\n\r\nLeftAndMain->show(SS_HTTPRequest)\r\nRequestHandler.php:288\r\n\r\nRequestHandler->handleAction(SS_HTTPRequest,show)\r\nController.php:202\r\n\r\nController->handleAction(SS_HTTPRequest,show)\r\nRequestHandler.php:200\r\n\r\nRequestHandler->handleRequest(SS_HTTPRequest,DataModel)\r\nController.php:158\r\n\r\nController->handleRequest(SS_HTTPRequest,DataModel)\r\nLeftAndMain.php:451\r\n\r\nLeftAndMain->handleRequest(SS_HTTPRequest,DataModel)\r\nAdminRootController.php:92\r\n\r\nAdminRootController->handleRequest(SS_HTTPRequest,DataModel)\r\nDirector.php:385\r\n\r\nDirector::handleRequest(SS_HTTPRequest,Session,DataModel)\r\nDirector.php:149\r\n\r\nDirector::direct(/admin/pages/edit/show/9,DataModel)\r\nmain.php:188\r\n</pre>\r\n\r\nShould we be disabling/hiding the Edit option on the context menu?  Or handling the EditForm returned value differently?"},"comment":{"url":"https://api.github.com/repos/silverstripe/silverstripe-cms/issues/comments/231038399","html_url":"https://github.com/silverstripe/silverstripe-cms/issues/1529#issuecomment-231038399","issue_url":"https://api.github.com/repos/silverstripe/silverstripe-cms/issues/1529","id":231038399,"user":{"login":"dhensby","id":563596,"avatar_url":"https://avatars.githubusercontent.com/u/563596?v=3","gravatar_id":"","url":"https://api.github.com/users/dhensby","html_url":"https://github.com/dhensby","followers_url":"https://api.github.com/users/dhensby/followers","following_url":"https://api.github.com/users/dhensby/following{/other_user}","gists_url":"https://api.github.com/users/dhensby/gists{/gist_id}","starred_url":"https://api.github.com/users/dhensby/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dhensby/subscriptions","organizations_url":"https://api.github.com/users/dhensby/orgs","repos_url":"https://api.github.com/users/dhensby/repos","events_url":"https://api.github.com/users/dhensby/events{/privacy}","received_events_url":"https://api.github.com/users/dhensby/received_events","type":"User","site_admin":false},"created_at":"2016-07-07T10:12:08Z","updated_at":"2016-07-07T10:12:08Z","body":"hmm, and my tests were with `canEdit` false only"}}
{"actor":{"display_login":"dhensby"}}