{"action":"created","issue":{"url":"https://api.github.com/repos/yiisoft/yii2/issues/7329","labels_url":"https://api.github.com/repos/yiisoft/yii2/issues/7329/labels{/name}","comments_url":"https://api.github.com/repos/yiisoft/yii2/issues/7329/comments","events_url":"https://api.github.com/repos/yiisoft/yii2/issues/7329/events","html_url":"https://github.com/yiisoft/yii2/issues/7329","id":58031371,"number":7329,"title":"How to in yii-advanced application RBAC table auth_assignment not define User_id it define user type","user":{"login":"rahulsinh","id":10724992,"avatar_url":"https://avatars.githubusercontent.com/u/10724992?v=3","gravatar_id":"","url":"https://api.github.com/users/rahulsinh","html_url":"https://github.com/rahulsinh","followers_url":"https://api.github.com/users/rahulsinh/followers","following_url":"https://api.github.com/users/rahulsinh/following{/other_user}","gists_url":"https://api.github.com/users/rahulsinh/gists{/gist_id}","starred_url":"https://api.github.com/users/rahulsinh/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rahulsinh/subscriptions","organizations_url":"https://api.github.com/users/rahulsinh/orgs","repos_url":"https://api.github.com/users/rahulsinh/repos","events_url":"https://api.github.com/users/rahulsinh/events{/privacy}","received_events_url":"https://api.github.com/users/rahulsinh/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-02-18T06:12:15Z","updated_at":"2015-02-18T09:31:36Z","closed_at":"2015-02-18T09:31:36Z","body":"@samdark Hii i want to give permission to create,update and delete according to user type\r\nfor example user type is customer so there are many customer are there so i am not given permission according User_id if user type is customer then he can not create ,update or delete so auth_assignment table define type and use type for permisssion."},"comment":{"url":"https://api.github.com/repos/yiisoft/yii2/issues/comments/74835794","html_url":"https://github.com/yiisoft/yii2/issues/7329#issuecomment-74835794","issue_url":"https://api.github.com/repos/yiisoft/yii2/issues/7329","id":74835794,"user":{"login":"samdark","id":47294,"avatar_url":"https://avatars.githubusercontent.com/u/47294?v=3","gravatar_id":"","url":"https://api.github.com/users/samdark","html_url":"https://github.com/samdark","followers_url":"https://api.github.com/users/samdark/followers","following_url":"https://api.github.com/users/samdark/following{/other_user}","gists_url":"https://api.github.com/users/samdark/gists{/gist_id}","starred_url":"https://api.github.com/users/samdark/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/samdark/subscriptions","organizations_url":"https://api.github.com/users/samdark/orgs","repos_url":"https://api.github.com/users/samdark/repos","events_url":"https://api.github.com/users/samdark/events{/privacy}","received_events_url":"https://api.github.com/users/samdark/received_events","type":"User","site_admin":false},"created_at":"2015-02-18T09:31:36Z","updated_at":"2015-02-18T09:31:36Z","body":"There's no need to store type in user table. Your type is a `Role` in terms of RBAC and permissions are `Permission`. Hierarchy would be the following:\r\n\r\n```\r\nCustomer\r\n  Create\r\n  Update\r\n  Delete\r\nAdmin\r\n  Customer\r\n  ViewStats\r\n```\r\n\r\nThen you're just assigning either `Customer` or `Admin` to your users [using RBAC API](http://www.yiiframework.com/doc-2.0/guide-security-authorization.html#building-authorization-data)."}}