{"action":"created","issue":{"url":"https://api.github.com/repos/yiisoft/yii2/issues/11599","repository_url":"https://api.github.com/repos/yiisoft/yii2","labels_url":"https://api.github.com/repos/yiisoft/yii2/issues/11599/labels{/name}","comments_url":"https://api.github.com/repos/yiisoft/yii2/issues/11599/comments","events_url":"https://api.github.com/repos/yiisoft/yii2/issues/11599/events","html_url":"https://github.com/yiisoft/yii2/issues/11599","id":155923787,"number":11599,"title":"Use case for yii\\rbac","user":{"login":"SamMousa","id":547021,"avatar_url":"https://avatars.githubusercontent.com/u/547021?v=3","gravatar_id":"","url":"https://api.github.com/users/SamMousa","html_url":"https://github.com/SamMousa","followers_url":"https://api.github.com/users/SamMousa/followers","following_url":"https://api.github.com/users/SamMousa/following{/other_user}","gists_url":"https://api.github.com/users/SamMousa/gists{/gist_id}","starred_url":"https://api.github.com/users/SamMousa/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/SamMousa/subscriptions","organizations_url":"https://api.github.com/users/SamMousa/orgs","repos_url":"https://api.github.com/users/SamMousa/repos","events_url":"https://api.github.com/users/SamMousa/events{/privacy}","received_events_url":"https://api.github.com/users/SamMousa/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/yiisoft/yii2/labels/feature:rbac","name":"feature:rbac","color":"bfd4f2"},{"url":"https://api.github.com/repos/yiisoft/yii2/labels/status:under%20discussion","name":"status:under discussion","color":"f7c6c7"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":9,"created_at":"2016-05-20T09:36:11Z","updated_at":"2016-05-26T06:06:12Z","closed_at":null,"body":"This is intended to be a discussion after which the docs may need updating / additional examples.\r\n\r\n1. Implementation of `yii\\rbac\\Rule` must be done in code.\r\n2. When saving the rule to the database, it saves the name of the rule and a serialized object.\r\n\r\nI have not found a clear use case for the serialization of the object into the database. I understand that it could be used to have the rule which contain logic be reused; but it is unclear when I would want that.\r\n\r\nAlternatively, would it not make more sense to just save the class name, any additional data, and recreate the rule and then pass the data to the execute method?\r\n\r\n"},"comment":{"url":"https://api.github.com/repos/yiisoft/yii2/issues/comments/221785528","html_url":"https://github.com/yiisoft/yii2/issues/11599#issuecomment-221785528","issue_url":"https://api.github.com/repos/yiisoft/yii2/issues/11599","id":221785528,"user":{"login":"SamMousa","id":547021,"avatar_url":"https://avatars.githubusercontent.com/u/547021?v=3","gravatar_id":"","url":"https://api.github.com/users/SamMousa","html_url":"https://github.com/SamMousa","followers_url":"https://api.github.com/users/SamMousa/followers","following_url":"https://api.github.com/users/SamMousa/following{/other_user}","gists_url":"https://api.github.com/users/SamMousa/gists{/gist_id}","starred_url":"https://api.github.com/users/SamMousa/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/SamMousa/subscriptions","organizations_url":"https://api.github.com/users/SamMousa/orgs","repos_url":"https://api.github.com/users/SamMousa/repos","events_url":"https://api.github.com/users/SamMousa/events{/privacy}","received_events_url":"https://api.github.com/users/SamMousa/received_events","type":"User","site_admin":false},"created_at":"2016-05-26T06:06:12Z","updated_at":"2016-05-26T06:06:12Z","body":"Okay, so consider the rating rule.\nFor it to be useful it must be related to an authorization item.\nAuthorization items have data; I can store the minimum required rating there.\n\nSince each authorization item has at most one related rule, and the only code that can use this data during access checking is in the rule, why would I ever need to store data in the rule itself?"}}
{"actor":{"display_login":"SamMousa"}}