{"action":"created","issue":{"url":"https://api.github.com/repos/rappasoft/laravel-5-boilerplate/issues/40","labels_url":"https://api.github.com/repos/rappasoft/laravel-5-boilerplate/issues/40/labels{/name}","comments_url":"https://api.github.com/repos/rappasoft/laravel-5-boilerplate/issues/40/comments","events_url":"https://api.github.com/repos/rappasoft/laravel-5-boilerplate/issues/40/events","html_url":"https://github.com/rappasoft/laravel-5-boilerplate/issues/40","id":93756135,"number":40,"title":"Permitted to enter admin section from Default User","user":{"login":"gaurav112","id":2445279,"avatar_url":"https://avatars.githubusercontent.com/u/2445279?v=3","gravatar_id":"","url":"https://api.github.com/users/gaurav112","html_url":"https://github.com/gaurav112","followers_url":"https://api.github.com/users/gaurav112/followers","following_url":"https://api.github.com/users/gaurav112/following{/other_user}","gists_url":"https://api.github.com/users/gaurav112/gists{/gist_id}","starred_url":"https://api.github.com/users/gaurav112/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gaurav112/subscriptions","organizations_url":"https://api.github.com/users/gaurav112/orgs","repos_url":"https://api.github.com/users/gaurav112/repos","events_url":"https://api.github.com/users/gaurav112/events{/privacy}","received_events_url":"https://api.github.com/users/gaurav112/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":3,"created_at":"2015-07-08T10:23:39Z","updated_at":"2015-07-08T13:05:45Z","closed_at":null,"body":"I was testing the Access functionality for the Default User and found out that i was able to access the admin section even though I was logged in through the Default User generated from the DB Seed\r\n\r\nI eventually found the problem, So thought should share:\r\n\r\nRouteNeedsRoleOrPermission.php\r\n\r\nFrom\r\n```\r\nif ($assets['needsAll'])\r\n\t\t\tif (! access()->hasRoles($assets['roles'], true) || ! access()->canMultiple($assets['permissions'], true))\r\n\t\t\t\treturn $this->getRedirectMethodAndGo($request, $params);\r\n\t\telse\r\n\t\t\tif (! access()->hasRoles($assets['roles'], false) && ! access()->canMultiple($assets['permissions'], false))\r\n\t\t\t\treturn $this->getRedirectMethodAndGo($request, $params);\r\n```\r\n\r\nTO\r\n\r\n```\r\nif ($assets['needsAll']) {\r\n            if (!access()->hasRoles($assets['roles'], true) || !access()->canMultiple($assets['permissions'], true)){\r\n                return $this->getRedirectMethodAndGo($request, $params);\r\n            }\r\n        }else {\r\n            if (!access()->hasRoles($assets['roles'], false) && !access()->canMultiple($assets['permissions'], false)){\r\n                return $this->getRedirectMethodAndGo($request, $params);\r\n            }\r\n        }\r\n```\r\n\r\nI had issues with the conditions bracket. "},"comment":{"url":"https://api.github.com/repos/rappasoft/laravel-5-boilerplate/issues/comments/119572106","html_url":"https://github.com/rappasoft/laravel-5-boilerplate/issues/40#issuecomment-119572106","issue_url":"https://api.github.com/repos/rappasoft/laravel-5-boilerplate/issues/40","id":119572106,"user":{"login":"rappasoft","id":6026504,"avatar_url":"https://avatars.githubusercontent.com/u/6026504?v=3","gravatar_id":"","url":"https://api.github.com/users/rappasoft","html_url":"https://github.com/rappasoft","followers_url":"https://api.github.com/users/rappasoft/followers","following_url":"https://api.github.com/users/rappasoft/following{/other_user}","gists_url":"https://api.github.com/users/rappasoft/gists{/gist_id}","starred_url":"https://api.github.com/users/rappasoft/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rappasoft/subscriptions","organizations_url":"https://api.github.com/users/rappasoft/orgs","repos_url":"https://api.github.com/users/rappasoft/repos","events_url":"https://api.github.com/users/rappasoft/events{/privacy}","received_events_url":"https://api.github.com/users/rappasoft/received_events","type":"User","site_admin":false},"created_at":"2015-07-08T13:05:44Z","updated_at":"2015-07-08T13:05:44Z","body":"Appreciate it."}}