{"action":"created","issue":{"url":"https://api.github.com/repos/amnah/yii2-user/issues/146","repository_url":"https://api.github.com/repos/amnah/yii2-user","labels_url":"https://api.github.com/repos/amnah/yii2-user/issues/146/labels{/name}","comments_url":"https://api.github.com/repos/amnah/yii2-user/issues/146/comments","events_url":"https://api.github.com/repos/amnah/yii2-user/issues/146/events","html_url":"https://github.com/amnah/yii2-user/issues/146","id":145525156,"number":146,"title":"Question: How do I check for role?","user":{"login":"Marcuzzz","id":7437046,"avatar_url":"https://avatars.githubusercontent.com/u/7437046?v=3","gravatar_id":"","url":"https://api.github.com/users/Marcuzzz","html_url":"https://github.com/Marcuzzz","followers_url":"https://api.github.com/users/Marcuzzz/followers","following_url":"https://api.github.com/users/Marcuzzz/following{/other_user}","gists_url":"https://api.github.com/users/Marcuzzz/gists{/gist_id}","starred_url":"https://api.github.com/users/Marcuzzz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Marcuzzz/subscriptions","organizations_url":"https://api.github.com/users/Marcuzzz/orgs","repos_url":"https://api.github.com/users/Marcuzzz/repos","events_url":"https://api.github.com/users/Marcuzzz/events{/privacy}","received_events_url":"https://api.github.com/users/Marcuzzz/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2016-04-03T18:15:04Z","updated_at":"2016-04-03T19:29:14Z","closed_at":null,"body":"```\r\nif (Yii::$app->user->getId() != 2 && !empty(Yii::$app->user) && !Yii::$app->user->can(\"admin\")) {\r\n            throw new ForbiddenHttpException(Yii::$app->user->getId());\r\n}\r\n```\r\nWorks.\r\nBut I added 'MyRole' to the database role table and check for the getRole function\r\n```\r\nif (Yii::$app->user->getRole() != 'MyRole' && !empty(Yii::$app->user) && !Yii::$app->user->can(\"admin\")) {\r\n            throw new ForbiddenHttpException(Yii::$app->user->getRole());\r\n}\r\n```\r\nResults in: Calling unknown method: backend\\modules\\user\\components\\User::getRole()\r\n\r\n"},"comment":{"url":"https://api.github.com/repos/amnah/yii2-user/issues/comments/205039962","html_url":"https://github.com/amnah/yii2-user/issues/146#issuecomment-205039962","issue_url":"https://api.github.com/repos/amnah/yii2-user/issues/146","id":205039962,"user":{"login":"Marcuzzz","id":7437046,"avatar_url":"https://avatars.githubusercontent.com/u/7437046?v=3","gravatar_id":"","url":"https://api.github.com/users/Marcuzzz","html_url":"https://github.com/Marcuzzz","followers_url":"https://api.github.com/users/Marcuzzz/followers","following_url":"https://api.github.com/users/Marcuzzz/following{/other_user}","gists_url":"https://api.github.com/users/Marcuzzz/gists{/gist_id}","starred_url":"https://api.github.com/users/Marcuzzz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Marcuzzz/subscriptions","organizations_url":"https://api.github.com/users/Marcuzzz/orgs","repos_url":"https://api.github.com/users/Marcuzzz/repos","events_url":"https://api.github.com/users/Marcuzzz/events{/privacy}","received_events_url":"https://api.github.com/users/Marcuzzz/received_events","type":"User","site_admin":false},"created_at":"2016-04-03T19:29:14Z","updated_at":"2016-04-03T19:29:14Z","body":"Cool Thx!!!"}}