{"action":"created","comment":{"url":"https://api.github.com/repos/praekelt/numi-api/pulls/comments/58896350","id":58896350,"diff_hunk":"@@ -191,6 +190,40 @@ Symbols\n *******\n Symbols are used in a :ref:`Dialogue <concepts-dialogues>` data structure as programmatically-usable strings. Their main use is for identifying and referencing sequences, blocks and block types.\n \n+\n+Permissions\n+~~~~~~~~~~~\n+A user's actions are limited by the permissions they have been granted. Users can be granted the following permissions:\n+\n+``admin``\n+*********\n+Grants create, archive, read and write access for all projects and dialogues, and publish access for all dialogues.\n+\n+``projects:create``\n+*******************\n+Grants access to create new projects. Users with this permission obtain ``project:admin`` access for the projects they create.\n+\n+``project:admin``\n+*****************\n+Grants create, archive, read, write and publish access for a given project's dialogues.\n+\n+``project:dialogues:read``\n+**************************\n+Grants read access for a given project's dialogues.\n+\n+``project:dialogues:write``\n+***************************\n+Grants write access for a given project's dialogues.\n+\n+``dialogue:read``\n+*****************\n+Grants read access for a given dialogue.\n+\n+``dialogue:write``\n+******************\n+Grants write access for a given dialogue.","path":"docs/index.rst","position":43,"original_position":43,"commit_id":"44202202d0f7b915bc2388884810311a2cf20956","original_commit_id":"44202202d0f7b915bc2388884810311a2cf20956","user":{"login":"justinvdm","id":1731223,"avatar_url":"https://avatars.githubusercontent.com/u/1731223?v=3","gravatar_id":"","url":"https://api.github.com/users/justinvdm","html_url":"https://github.com/justinvdm","followers_url":"https://api.github.com/users/justinvdm/followers","following_url":"https://api.github.com/users/justinvdm/following{/other_user}","gists_url":"https://api.github.com/users/justinvdm/gists{/gist_id}","starred_url":"https://api.github.com/users/justinvdm/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/justinvdm/subscriptions","organizations_url":"https://api.github.com/users/justinvdm/orgs","repos_url":"https://api.github.com/users/justinvdm/repos","events_url":"https://api.github.com/users/justinvdm/events{/privacy}","received_events_url":"https://api.github.com/users/justinvdm/received_events","type":"User","site_admin":false},"body":"We could obviously support more permission levels than these: for example, we could include a permission to only create dialogues for a project, or to be able to archive dialogues for a project. I tried to think of which groups of permissions were the most sensible:\r\n  - Being able to create a dialogue in a project but not having read or write access to other dialogues in a project sounds like it could get complex. One thing we would need to handle would be granting read, write and archive access for dialogues that users has created permission (should be able to publish for that dialogue too?). I'm not such complex permissions.\r\n  - If we had a separate publish permission, we would probably need to grant users with that permission read and write access (otherwise, they wouldn't be able to undo their publishes or revert to previous publishes if their newly published dialogue breaks). I'm also not sure if there are cases where one can read, write, and publish for a dialogue, but not publish for other dialogues in the same project (this would get even more complicated once we support delegating from one dialogue to another).\r\n\r\nI vote we try stick to simpler permission like the ones above, and add more finer grained permissions as the use cases appear.","created_at":"2016-04-07T15:53:16Z","updated_at":"2016-04-07T15:53:16Z","html_url":"https://github.com/praekelt/numi-api/pull/11#discussion_r58896350","pull_request_url":"https://api.github.com/repos/praekelt/numi-api/pulls/11","_links":{"self":{"href":"https://api.github.com/repos/praekelt/numi-api/pulls/comments/58896350"},"html":{"href":"https://github.com/praekelt/numi-api/pull/11#discussion_r58896350"},"pull_request":{"href":"https://api.github.com/repos/praekelt/numi-api/pulls/11"}}},"pull_request":{"url":"https://api.github.com/repos/praekelt/numi-api/pulls/11","id":65652480,"html_url":"https://github.com/praekelt/numi-api/pull/11","diff_url":"https://github.com/praekelt/numi-api/pull/11.diff","patch_url":"https://github.com/praekelt/numi-api/pull/11.patch","issue_url":"https://api.github.com/repos/praekelt/numi-api/issues/11","number":11,"state":"open","locked":false,"title":"Document permission levels","user":{"login":"justinvdm","id":1731223,"avatar_url":"https://avatars.githubusercontent.com/u/1731223?v=3","gravatar_id":"","url":"https://api.github.com/users/justinvdm","html_url":"https://github.com/justinvdm","followers_url":"https://api.github.com/users/justinvdm/followers","following_url":"https://api.github.com/users/justinvdm/following{/other_user}","gists_url":"https://api.github.com/users/justinvdm/gists{/gist_id}","starred_url":"https://api.github.com/users/justinvdm/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/justinvdm/subscriptions","organizations_url":"https://api.github.com/users/justinvdm/orgs","repos_url":"https://api.github.com/users/justinvdm/repos","events_url":"https://api.github.com/users/justinvdm/events{/privacy}","received_events_url":"https://api.github.com/users/justinvdm/received_events","type":"User","site_admin":false},"body":"","created_at":"2016-04-07T15:43:09Z","updated_at":"2016-04-07T15:53:16Z","closed_at":null,"merged_at":null,"merge_commit_sha":"12f465f2a04a972a922bf7165d0705a3c4530c31","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/praekelt/numi-api/pulls/11/commits","review_comments_url":"https://api.github.com/repos/praekelt/numi-api/pulls/11/comments","review_comment_url":"https://api.github.com/repos/praekelt/numi-api/pulls/comments{/number}","comments_url":"https://api.github.com/repos/praekelt/numi-api/issues/11/comments","statuses_url":"https://api.github.com/repos/praekelt/numi-api/statuses/44202202d0f7b915bc2388884810311a2cf20956","head":{"label":"praekelt:feature/issue-11-document-permission-levels","ref":"feature/issue-11-document-permission-levels","sha":"44202202d0f7b915bc2388884810311a2cf20956","user":{"login":"praekelt","id":81810,"avatar_url":"https://avatars.githubusercontent.com/u/81810?v=3","gravatar_id":"","url":"https://api.github.com/users/praekelt","html_url":"https://github.com/praekelt","followers_url":"https://api.github.com/users/praekelt/followers","following_url":"https://api.github.com/users/praekelt/following{/other_user}","gists_url":"https://api.github.com/users/praekelt/gists{/gist_id}","starred_url":"https://api.github.com/users/praekelt/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/praekelt/subscriptions","organizations_url":"https://api.github.com/users/praekelt/orgs","repos_url":"https://api.github.com/users/praekelt/repos","events_url":"https://api.github.com/users/praekelt/events{/privacy}","received_events_url":"https://api.github.com/users/praekelt/received_events","type":"Organization","site_admin":false},"repo":{"id":54625615,"name":"numi-api","full_name":"praekelt/numi-api","owner":{"login":"praekelt","id":81810,"avatar_url":"https://avatars.githubusercontent.com/u/81810?v=3","gravatar_id":"","url":"https://api.github.com/users/praekelt","html_url":"https://github.com/praekelt","followers_url":"https://api.github.com/users/praekelt/followers","following_url":"https://api.github.com/users/praekelt/following{/other_user}","gists_url":"https://api.github.com/users/praekelt/gists{/gist_id}","starred_url":"https://api.github.com/users/praekelt/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/praekelt/subscriptions","organizations_url":"https://api.github.com/users/praekelt/orgs","repos_url":"https://api.github.com/users/praekelt/repos","events_url":"https://api.github.com/users/praekelt/events{/privacy}","received_events_url":"https://api.github.com/users/praekelt/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/praekelt/numi-api","description":"Numi's HTTP API","fork":false,"url":"https://api.github.com/repos/praekelt/numi-api","forks_url":"https://api.github.com/repos/praekelt/numi-api/forks","keys_url":"https://api.github.com/repos/praekelt/numi-api/keys{/key_id}","collaborators_url":"https://api.github.com/repos/praekelt/numi-api/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/praekelt/numi-api/teams","hooks_url":"https://api.github.com/repos/praekelt/numi-api/hooks","issue_events_url":"https://api.github.com/repos/praekelt/numi-api/issues/events{/number}","events_url":"https://api.github.com/repos/praekelt/numi-api/events","assignees_url":"https://api.github.com/repos/praekelt/numi-api/assignees{/user}","branches_url":"https://api.github.com/repos/praekelt/numi-api/branches{/branch}","tags_url":"https://api.github.com/repos/praekelt/numi-api/tags","blobs_url":"https://api.github.com/repos/praekelt/numi-api/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/praekelt/numi-api/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/praekelt/numi-api/git/refs{/sha}","trees_url":"https://api.github.com/repos/praekelt/numi-api/git/trees{/sha}","statuses_url":"https://api.github.com/repos/praekelt/numi-api/statuses/{sha}","languages_url":"https://api.github.com/repos/praekelt/numi-api/languages","stargazers_url":"https://api.github.com/repos/praekelt/numi-api/stargazers","contributors_url":"https://api.github.com/repos/praekelt/numi-api/contributors","subscribers_url":"https://api.github.com/repos/praekelt/numi-api/subscribers","subscription_url":"https://api.github.com/repos/praekelt/numi-api/subscription","commits_url":"https://api.github.com/repos/praekelt/numi-api/commits{/sha}","git_commits_url":"https://api.github.com/repos/praekelt/numi-api/git/commits{/sha}","comments_url":"https://api.github.com/repos/praekelt/numi-api/comments{/number}","issue_comment_url":"https://api.github.com/repos/praekelt/numi-api/issues/comments{/number}","contents_url":"https://api.github.com/repos/praekelt/numi-api/contents/{+path}","compare_url":"https://api.github.com/repos/praekelt/numi-api/compare/{base}...{head}","merges_url":"https://api.github.com/repos/praekelt/numi-api/merges","archive_url":"https://api.github.com/repos/praekelt/numi-api/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/praekelt/numi-api/downloads","issues_url":"https://api.github.com/repos/praekelt/numi-api/issues{/number}","pulls_url":"https://api.github.com/repos/praekelt/numi-api/pulls{/number}","milestones_url":"https://api.github.com/repos/praekelt/numi-api/milestones{/number}","notifications_url":"https://api.github.com/repos/praekelt/numi-api/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/praekelt/numi-api/labels{/name}","releases_url":"https://api.github.com/repos/praekelt/numi-api/releases{/id}","deployments_url":"https://api.github.com/repos/praekelt/numi-api/deployments","created_at":"2016-03-24T08:13:38Z","updated_at":"2016-03-24T08:13:38Z","pushed_at":"2016-04-07T15:43:09Z","git_url":"git://github.com/praekelt/numi-api.git","ssh_url":"git@github.com:praekelt/numi-api.git","clone_url":"https://github.com/praekelt/numi-api.git","svn_url":"https://github.com/praekelt/numi-api","homepage":null,"size":148,"stargazers_count":0,"watchers_count":0,"language":null,"has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":6,"forks":0,"open_issues":6,"watchers":0,"default_branch":"develop"}},"base":{"label":"praekelt:develop","ref":"develop","sha":"fa94a4df052d02821e82da13286b1e3bb733d1e1","user":{"login":"praekelt","id":81810,"avatar_url":"https://avatars.githubusercontent.com/u/81810?v=3","gravatar_id":"","url":"https://api.github.com/users/praekelt","html_url":"https://github.com/praekelt","followers_url":"https://api.github.com/users/praekelt/followers","following_url":"https://api.github.com/users/praekelt/following{/other_user}","gists_url":"https://api.github.com/users/praekelt/gists{/gist_id}","starred_url":"https://api.github.com/users/praekelt/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/praekelt/subscriptions","organizations_url":"https://api.github.com/users/praekelt/orgs","repos_url":"https://api.github.com/users/praekelt/repos","events_url":"https://api.github.com/users/praekelt/events{/privacy}","received_events_url":"https://api.github.com/users/praekelt/received_events","type":"Organization","site_admin":false},"repo":{"id":54625615,"name":"numi-api","full_name":"praekelt/numi-api","owner":{"login":"praekelt","id":81810,"avatar_url":"https://avatars.githubusercontent.com/u/81810?v=3","gravatar_id":"","url":"https://api.github.com/users/praekelt","html_url":"https://github.com/praekelt","followers_url":"https://api.github.com/users/praekelt/followers","following_url":"https://api.github.com/users/praekelt/following{/other_user}","gists_url":"https://api.github.com/users/praekelt/gists{/gist_id}","starred_url":"https://api.github.com/users/praekelt/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/praekelt/subscriptions","organizations_url":"https://api.github.com/users/praekelt/orgs","repos_url":"https://api.github.com/users/praekelt/repos","events_url":"https://api.github.com/users/praekelt/events{/privacy}","received_events_url":"https://api.github.com/users/praekelt/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/praekelt/numi-api","description":"Numi's HTTP API","fork":false,"url":"https://api.github.com/repos/praekelt/numi-api","forks_url":"https://api.github.com/repos/praekelt/numi-api/forks","keys_url":"https://api.github.com/repos/praekelt/numi-api/keys{/key_id}","collaborators_url":"https://api.github.com/repos/praekelt/numi-api/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/praekelt/numi-api/teams","hooks_url":"https://api.github.com/repos/praekelt/numi-api/hooks","issue_events_url":"https://api.github.com/repos/praekelt/numi-api/issues/events{/number}","events_url":"https://api.github.com/repos/praekelt/numi-api/events","assignees_url":"https://api.github.com/repos/praekelt/numi-api/assignees{/user}","branches_url":"https://api.github.com/repos/praekelt/numi-api/branches{/branch}","tags_url":"https://api.github.com/repos/praekelt/numi-api/tags","blobs_url":"https://api.github.com/repos/praekelt/numi-api/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/praekelt/numi-api/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/praekelt/numi-api/git/refs{/sha}","trees_url":"https://api.github.com/repos/praekelt/numi-api/git/trees{/sha}","statuses_url":"https://api.github.com/repos/praekelt/numi-api/statuses/{sha}","languages_url":"https://api.github.com/repos/praekelt/numi-api/languages","stargazers_url":"https://api.github.com/repos/praekelt/numi-api/stargazers","contributors_url":"https://api.github.com/repos/praekelt/numi-api/contributors","subscribers_url":"https://api.github.com/repos/praekelt/numi-api/subscribers","subscription_url":"https://api.github.com/repos/praekelt/numi-api/subscription","commits_url":"https://api.github.com/repos/praekelt/numi-api/commits{/sha}","git_commits_url":"https://api.github.com/repos/praekelt/numi-api/git/commits{/sha}","comments_url":"https://api.github.com/repos/praekelt/numi-api/comments{/number}","issue_comment_url":"https://api.github.com/repos/praekelt/numi-api/issues/comments{/number}","contents_url":"https://api.github.com/repos/praekelt/numi-api/contents/{+path}","compare_url":"https://api.github.com/repos/praekelt/numi-api/compare/{base}...{head}","merges_url":"https://api.github.com/repos/praekelt/numi-api/merges","archive_url":"https://api.github.com/repos/praekelt/numi-api/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/praekelt/numi-api/downloads","issues_url":"https://api.github.com/repos/praekelt/numi-api/issues{/number}","pulls_url":"https://api.github.com/repos/praekelt/numi-api/pulls{/number}","milestones_url":"https://api.github.com/repos/praekelt/numi-api/milestones{/number}","notifications_url":"https://api.github.com/repos/praekelt/numi-api/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/praekelt/numi-api/labels{/name}","releases_url":"https://api.github.com/repos/praekelt/numi-api/releases{/id}","deployments_url":"https://api.github.com/repos/praekelt/numi-api/deployments","created_at":"2016-03-24T08:13:38Z","updated_at":"2016-03-24T08:13:38Z","pushed_at":"2016-04-07T15:43:09Z","git_url":"git://github.com/praekelt/numi-api.git","ssh_url":"git@github.com:praekelt/numi-api.git","clone_url":"https://github.com/praekelt/numi-api.git","svn_url":"https://github.com/praekelt/numi-api","homepage":null,"size":148,"stargazers_count":0,"watchers_count":0,"language":null,"has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":6,"forks":0,"open_issues":6,"watchers":0,"default_branch":"develop"}},"_links":{"self":{"href":"https://api.github.com/repos/praekelt/numi-api/pulls/11"},"html":{"href":"https://github.com/praekelt/numi-api/pull/11"},"issue":{"href":"https://api.github.com/repos/praekelt/numi-api/issues/11"},"comments":{"href":"https://api.github.com/repos/praekelt/numi-api/issues/11/comments"},"review_comments":{"href":"https://api.github.com/repos/praekelt/numi-api/pulls/11/comments"},"review_comment":{"href":"https://api.github.com/repos/praekelt/numi-api/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/praekelt/numi-api/pulls/11/commits"},"statuses":{"href":"https://api.github.com/repos/praekelt/numi-api/statuses/44202202d0f7b915bc2388884810311a2cf20956"}}}}