{"action":"created","issue":{"url":"https://api.github.com/repos/keystonejs/keystone-test-project/issues/21","repository_url":"https://api.github.com/repos/keystonejs/keystone-test-project","labels_url":"https://api.github.com/repos/keystonejs/keystone-test-project/issues/21/labels{/name}","comments_url":"https://api.github.com/repos/keystonejs/keystone-test-project/issues/21/comments","events_url":"https://api.github.com/repos/keystonejs/keystone-test-project/issues/21/events","html_url":"https://github.com/keystonejs/keystone-test-project/pull/21","id":174706553,"number":21,"title":"List Permissions Proposal","user":{"login":"JedWatson","id":872310,"avatar_url":"https://avatars.githubusercontent.com/u/872310?v=3","gravatar_id":"","url":"https://api.github.com/users/JedWatson","html_url":"https://github.com/JedWatson","followers_url":"https://api.github.com/users/JedWatson/followers","following_url":"https://api.github.com/users/JedWatson/following{/other_user}","gists_url":"https://api.github.com/users/JedWatson/gists{/gist_id}","starred_url":"https://api.github.com/users/JedWatson/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/JedWatson/subscriptions","organizations_url":"https://api.github.com/users/JedWatson/orgs","repos_url":"https://api.github.com/users/JedWatson/repos","events_url":"https://api.github.com/users/JedWatson/events{/privacy}","received_events_url":"https://api.github.com/users/JedWatson/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":13,"created_at":"2016-09-02T08:25:53Z","updated_at":"2016-10-03T13:18:13Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/keystonejs/keystone-test-project/pulls/21","html_url":"https://github.com/keystonejs/keystone-test-project/pull/21","diff_url":"https://github.com/keystonejs/keystone-test-project/pull/21.diff","patch_url":"https://github.com/keystonejs/keystone-test-project/pull/21.patch"},"body":"This is a proposed implementation of List Permissions that may be supported by Keystone.\r\n\r\nTo explain what's going on:\r\n\r\n## Idea 1\r\n\r\nYou can dynamically change list and field options (specifically `hidden`, `noedit` and `nodelete`) based on the current user / item data. This lets you customise what's displayed in the Admin UI for a particular user (could be a permission group)\r\n\r\nTo do this, you can set the following methods on the List instance:\r\n\r\n```js\r\nuserOptions (user) => { /* list options to override for the user */ } \r\nuserFieldOptions (user) => { /* field paths containing options to override for each field */ }\r\nitemOptions (item, user) => { /* list options to override on a per-item basis */ }\r\nitemFieldOptions (item, user) => { /* field paths containing options to override on a per-item basis */ }\r\n```\r\n\r\n## Idea 2\r\n\r\nYou can directly modify the queries used (after filters are applied) for Admin UI endpoints, including:\r\n\r\n* get item(s)\r\n* update item(s)\r\n* delete item(s)\r\n* download export\r\n\r\nYou could use this, for example, to limit which items a user can see or interact with in any way.\r\n\r\nTo do this, you could set the following methods on the List instance:\r\n\r\n```js\r\nmodifyListQuery (user, query) // modify the query by reference, based on the current user\r\nmodifyItemData (user, item) // update properties on the item before it is saved\r\n```\r\n\r\n## Example use case\r\n\r\nThis PR implements these features to achieve two use cases:\r\n\r\n* Protecting the demo user from being updated or deleted using generic functionality\r\n* Adding a concept of Editor Users, and implementing restrictions on Posts, where non-editors can only see their own posts, can't change the state of a post, and can't edit certain fields after the post has been published"},"comment":{"url":"https://api.github.com/repos/keystonejs/keystone-test-project/issues/comments/251103246","html_url":"https://github.com/keystonejs/keystone-test-project/pull/21#issuecomment-251103246","issue_url":"https://api.github.com/repos/keystonejs/keystone-test-project/issues/21","id":251103246,"user":{"login":"arturkasperek","id":6894763,"avatar_url":"https://avatars.githubusercontent.com/u/6894763?v=3","gravatar_id":"","url":"https://api.github.com/users/arturkasperek","html_url":"https://github.com/arturkasperek","followers_url":"https://api.github.com/users/arturkasperek/followers","following_url":"https://api.github.com/users/arturkasperek/following{/other_user}","gists_url":"https://api.github.com/users/arturkasperek/gists{/gist_id}","starred_url":"https://api.github.com/users/arturkasperek/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/arturkasperek/subscriptions","organizations_url":"https://api.github.com/users/arturkasperek/orgs","repos_url":"https://api.github.com/users/arturkasperek/repos","events_url":"https://api.github.com/users/arturkasperek/events{/privacy}","received_events_url":"https://api.github.com/users/arturkasperek/received_events","type":"User","site_admin":false},"created_at":"2016-10-03T13:18:13Z","updated_at":"2016-10-03T13:18:13Z","body":"Any news about this feature ?"}}
{"actor":{"display_login":"arturkasperek"}}