{"action":"created","issue":{"url":"https://api.github.com/repos/stalniy/casl/issues/135","repository_url":"https://api.github.com/repos/stalniy/casl","labels_url":"https://api.github.com/repos/stalniy/casl/issues/135/labels{/name}","comments_url":"https://api.github.com/repos/stalniy/casl/issues/135/comments","events_url":"https://api.github.com/repos/stalniy/casl/issues/135/events","html_url":"https://github.com/stalniy/casl/issues/135","id":392253221,"node_id":"MDU6SXNzdWUzOTIyNTMyMjE=","number":135,"title":"Really hard to grasp the concepts as a newbie","user":{"login":"GsHeri","id":21007980,"node_id":"MDQ6VXNlcjIxMDA3OTgw","avatar_url":"https://avatars0.githubusercontent.com/u/21007980?v=4","gravatar_id":"","url":"https://api.github.com/users/GsHeri","html_url":"https://github.com/GsHeri","followers_url":"https://api.github.com/users/GsHeri/followers","following_url":"https://api.github.com/users/GsHeri/following{/other_user}","gists_url":"https://api.github.com/users/GsHeri/gists{/gist_id}","starred_url":"https://api.github.com/users/GsHeri/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/GsHeri/subscriptions","organizations_url":"https://api.github.com/users/GsHeri/orgs","repos_url":"https://api.github.com/users/GsHeri/repos","events_url":"https://api.github.com/users/GsHeri/events{/privacy}","received_events_url":"https://api.github.com/users/GsHeri/received_events","type":"User","site_admin":false},"labels":[{"id":649817643,"node_id":"MDU6TGFiZWw2NDk4MTc2NDM=","url":"https://api.github.com/repos/stalniy/casl/labels/question","name":"question","color":"cc317c","default":true}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":5,"created_at":"2018-12-18T17:10:38Z","updated_at":"2018-12-28T17:18:53Z","closed_at":null,"author_association":"NONE","body":"Hi there! I really want to use CASL for my app, i've read the docs and examples multiple times, but i pretty much have no idea how to use it exactly.\r\n\r\nWhat i don't get especially is:\r\nWhat exactly are things like 'read' and 'all' ?\r\nwhere/how are they defined? how can i define them myself?\r\n\r\nif i want to give users the ability to delete a post and display a button if they can... like `can('delete', 'post')` how does CASL know what 'delete', 'post' and 'button' are? it has to be defined somewhere, but i haven't found out where. probably it's related to db-query verbs, but then again there are cases where it can't be just translated to CRUD, right? it seems to \"just work\" in all the examples i have seen. so basically i have no idea how to translate that to my app, where i have to customize that.\r\n\r\nis there a beginner-friendly explanation somewhere that i have overlooked? something that covers the absolute basics? \r\nsorry if this seems stupid, i just can't get my head around it it seems :/ \r\n\r\nregards :)"},"comment":{"url":"https://api.github.com/repos/stalniy/casl/issues/comments/450394891","html_url":"https://github.com/stalniy/casl/issues/135#issuecomment-450394891","issue_url":"https://api.github.com/repos/stalniy/casl/issues/135","id":450394891,"node_id":"MDEyOklzc3VlQ29tbWVudDQ1MDM5NDg5MQ==","user":{"login":"GsHeri","id":21007980,"node_id":"MDQ6VXNlcjIxMDA3OTgw","avatar_url":"https://avatars0.githubusercontent.com/u/21007980?v=4","gravatar_id":"","url":"https://api.github.com/users/GsHeri","html_url":"https://github.com/GsHeri","followers_url":"https://api.github.com/users/GsHeri/followers","following_url":"https://api.github.com/users/GsHeri/following{/other_user}","gists_url":"https://api.github.com/users/GsHeri/gists{/gist_id}","starred_url":"https://api.github.com/users/GsHeri/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/GsHeri/subscriptions","organizations_url":"https://api.github.com/users/GsHeri/orgs","repos_url":"https://api.github.com/users/GsHeri/repos","events_url":"https://api.github.com/users/GsHeri/events{/privacy}","received_events_url":"https://api.github.com/users/GsHeri/received_events","type":"User","site_admin":false},"created_at":"2018-12-28T17:18:53Z","updated_at":"2018-12-28T17:18:53Z","author_association":"NONE","body":"> You create/define abilities, actions and subject types based on your business requirements.\r\n> \r\n> So, for the blog application their may be this subject types:\r\n> \r\n> * Post\r\n> * User\r\n> \r\n> User can read info about any other user and can update own info\r\n> \r\n> Any user in the system can create posts, update own posts and read any other post which was create by somebody else.\r\n\r\n\r\nWhere/how do i define what a \"Post\" and a \"User\" is? how does CASL get to know that?\r\nThere has to be somewhere in my app where i write something like.... uhmmm {subject: 'Post'}? do i just put that into each component? or how exactly does that work? i think that's my main problem. \r\n\"User\" and \"Post\" don't have any meaning per se, so i'll have to define them somewhere, right?\r\n\r\nThank you very much so far :)"}}
{"actor":{"display_login":"GsHeri"}}