{"action":"created","issue":{"url":"https://api.github.com/repos/Narzerus/angular-permission/issues/40","labels_url":"https://api.github.com/repos/Narzerus/angular-permission/issues/40/labels{/name}","comments_url":"https://api.github.com/repos/Narzerus/angular-permission/issues/40/comments","events_url":"https://api.github.com/repos/Narzerus/angular-permission/issues/40/events","html_url":"https://github.com/Narzerus/angular-permission/issues/40","id":54881673,"number":40,"title":"Permission directive","user":{"login":"Narzerus","id":1808674,"avatar_url":"https://avatars.githubusercontent.com/u/1808674?v=3","gravatar_id":"","url":"https://api.github.com/users/Narzerus","html_url":"https://github.com/Narzerus","followers_url":"https://api.github.com/users/Narzerus/followers","following_url":"https://api.github.com/users/Narzerus/following{/other_user}","gists_url":"https://api.github.com/users/Narzerus/gists{/gist_id}","starred_url":"https://api.github.com/users/Narzerus/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Narzerus/subscriptions","organizations_url":"https://api.github.com/users/Narzerus/orgs","repos_url":"https://api.github.com/users/Narzerus/repos","events_url":"https://api.github.com/users/Narzerus/events{/privacy}","received_events_url":"https://api.github.com/users/Narzerus/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/Narzerus/angular-permission/labels/discussion","name":"discussion","color":"fad8c7"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":4,"created_at":"2015-01-20T13:17:35Z","updated_at":"2015-02-20T21:26:48Z","closed_at":null,"body":"In this discussion we will decide about the first directive for this module.\r\n\r\nThe first idea mentioned in other topics such as #28 is to create a directive which either shows or hide an element depending on a permission's resolution.\r\n\r\nA possible approach could be:\r\n\r\n```html\r\n<a sref=\"post.delete\" rp-only=\"Admin\" />Delete post</a>\r\n\r\n<a sref=\"posts.index\" rp-except=\"Anonymous\" />View posts</a>\r\n```\r\n\r\nFeel free to contribute to this discussion, post your ideas and concerns.\r\n\r\nAlso have a look at #37 and see what you like and don't from it, get some ideas and whatnot\r\n\r\n\r\nCheers!"},"comment":{"url":"https://api.github.com/repos/Narzerus/angular-permission/issues/comments/75322039","html_url":"https://github.com/Narzerus/angular-permission/issues/40#issuecomment-75322039","issue_url":"https://api.github.com/repos/Narzerus/angular-permission/issues/40","id":75322039,"user":{"login":"Narzerus","id":1808674,"avatar_url":"https://avatars.githubusercontent.com/u/1808674?v=3","gravatar_id":"","url":"https://api.github.com/users/Narzerus","html_url":"https://github.com/Narzerus","followers_url":"https://api.github.com/users/Narzerus/followers","following_url":"https://api.github.com/users/Narzerus/following{/other_user}","gists_url":"https://api.github.com/users/Narzerus/gists{/gist_id}","starred_url":"https://api.github.com/users/Narzerus/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Narzerus/subscriptions","organizations_url":"https://api.github.com/users/Narzerus/orgs","repos_url":"https://api.github.com/users/Narzerus/repos","events_url":"https://api.github.com/users/Narzerus/events{/privacy}","received_events_url":"https://api.github.com/users/Narzerus/received_events","type":"User","site_admin":false},"created_at":"2015-02-20T21:26:48Z","updated_at":"2015-02-20T21:26:48Z","body":"@lesterrivera So the **ng-if-permissions** idea would only be useful when used in links to another state, I think something more general would work as the first approach\r\n\r\nSomething like an **ng-if** but fed with roles, so:\r\n\r\n```html\r\n  <pe-except=\"User, Admin\">\r\n    <button>Some button that is not shown to users and admins </button>\r\n  </pe-except>\r\n```"}}