{"action":"created","comment":{"url":"https://api.github.com/repos/SkygearIO/skygear-doc/pulls/comments/70781603","id":70781603,"diff_hunk":"@@ -1 +1,119 @@\n-Coming soon\n+<a name='acl-type'></a>\n+## Access Type\n+\n+There are two types of access for each record: read and write.\n+- Read access allows querying and fetching records, which includes getting\n+  all the fields of records as well as the access control settings.\n+- Write access allows saving and deleting records, which includes adding,\n+  updating and removing all fields of records as well as access control\n+  settings for the record.\n+\n+However, even with write access, ownership of records cannot be changed.\n+\n+<a name='acl-default'></a>\n+## Default ACL Settings\n+\n+By default, read access is granted to the public and write access is granted\n+only to owner of the record. You can change this behavior as well:\n+\n+``` javascript\n+var acl = new skygear.ACL();\n+// choose one setting among the three\n+acl.setPublicNoAccess();\n+acl.setPublicReadOnly(); // default\n+acl.setPublicReadWriteAccess();\n+skygear.setDefaultACL(acl); // will change skygear.defaultACL\n+\n+skygear.defaultACL.hasPublicReadAccess(); // default true\n+skygear.defaultACL.hasPublicWriteAccess(); // default false\n+```\n+\n+\n+<a name='acl-user'></a>\n+## ACL by User\n+\n+Suppose you have three user objects: `enemy`, `visitor` and `friend`.","path":"content/js/access-control.md","position":36,"original_position":36,"commit_id":"a0b56d901b78df69774fef619bf8512eca9ad54a","original_commit_id":"a0b56d901b78df69774fef619bf8512eca9ad54a","user":{"login":"bensonby","id":246195,"avatar_url":"https://avatars.githubusercontent.com/u/246195?v=3","gravatar_id":"","url":"https://api.github.com/users/bensonby","html_url":"https://github.com/bensonby","followers_url":"https://api.github.com/users/bensonby/followers","following_url":"https://api.github.com/users/bensonby/following{/other_user}","gists_url":"https://api.github.com/users/bensonby/gists{/gist_id}","starred_url":"https://api.github.com/users/bensonby/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bensonby/subscriptions","organizations_url":"https://api.github.com/users/bensonby/orgs","repos_url":"https://api.github.com/users/bensonby/repos","events_url":"https://api.github.com/users/bensonby/events{/privacy}","received_events_url":"https://api.github.com/users/bensonby/received_events","type":"User","site_admin":false},"body":"These names do not sound like proper `users` but relationship or user roles. You may want to have names like `Bob`, `Mary`, etc.","created_at":"2016-07-14T10:15:13Z","updated_at":"2016-07-14T10:15:13Z","html_url":"https://github.com/SkygearIO/skygear-doc/pull/156#discussion_r70781603","pull_request_url":"https://api.github.com/repos/SkygearIO/skygear-doc/pulls/156","_links":{"self":{"href":"https://api.github.com/repos/SkygearIO/skygear-doc/pulls/comments/70781603"},"html":{"href":"https://github.com/SkygearIO/skygear-doc/pull/156#discussion_r70781603"},"pull_request":{"href":"https://api.github.com/repos/SkygearIO/skygear-doc/pulls/156"}}},"pull_request":{"url":"https://api.github.com/repos/SkygearIO/skygear-doc/pulls/156","id":77248698,"html_url":"https://github.com/SkygearIO/skygear-doc/pull/156","diff_url":"https://github.com/SkygearIO/skygear-doc/pull/156.diff","patch_url":"https://github.com/SkygearIO/skygear-doc/pull/156.patch","issue_url":"https://api.github.com/repos/SkygearIO/skygear-doc/issues/156","number":156,"state":"open","locked":false,"title":"[JS] Improve Access Control Page","user":{"login":"TakLee96","id":5365444,"avatar_url":"https://avatars.githubusercontent.com/u/5365444?v=3","gravatar_id":"","url":"https://api.github.com/users/TakLee96","html_url":"https://github.com/TakLee96","followers_url":"https://api.github.com/users/TakLee96/followers","following_url":"https://api.github.com/users/TakLee96/following{/other_user}","gists_url":"https://api.github.com/users/TakLee96/gists{/gist_id}","starred_url":"https://api.github.com/users/TakLee96/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/TakLee96/subscriptions","organizations_url":"https://api.github.com/users/TakLee96/orgs","repos_url":"https://api.github.com/users/TakLee96/repos","events_url":"https://api.github.com/users/TakLee96/events{/privacy}","received_events_url":"https://api.github.com/users/TakLee96/received_events","type":"User","site_admin":false},"body":"connects #96 ","created_at":"2016-07-13T08:27:22Z","updated_at":"2016-07-14T10:15:13Z","closed_at":null,"merged_at":null,"merge_commit_sha":"59014afb32319b25d089992835e78cd9823f959c","assignee":{"login":"rickmak","id":62677,"avatar_url":"https://avatars.githubusercontent.com/u/62677?v=3","gravatar_id":"","url":"https://api.github.com/users/rickmak","html_url":"https://github.com/rickmak","followers_url":"https://api.github.com/users/rickmak/followers","following_url":"https://api.github.com/users/rickmak/following{/other_user}","gists_url":"https://api.github.com/users/rickmak/gists{/gist_id}","starred_url":"https://api.github.com/users/rickmak/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rickmak/subscriptions","organizations_url":"https://api.github.com/users/rickmak/orgs","repos_url":"https://api.github.com/users/rickmak/repos","events_url":"https://api.github.com/users/rickmak/events{/privacy}","received_events_url":"https://api.github.com/users/rickmak/received_events","type":"User","site_admin":false},"assignees":[{"login":"rickmak","id":62677,"avatar_url":"https://avatars.githubusercontent.com/u/62677?v=3","gravatar_id":"","url":"https://api.github.com/users/rickmak","html_url":"https://github.com/rickmak","followers_url":"https://api.github.com/users/rickmak/followers","following_url":"https://api.github.com/users/rickmak/following{/other_user}","gists_url":"https://api.github.com/users/rickmak/gists{/gist_id}","starred_url":"https://api.github.com/users/rickmak/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rickmak/subscriptions","organizations_url":"https://api.github.com/users/rickmak/orgs","repos_url":"https://api.github.com/users/rickmak/repos","events_url":"https://api.github.com/users/rickmak/events{/privacy}","received_events_url":"https://api.github.com/users/rickmak/received_events","type":"User","site_admin":false},{"login":"bensonby","id":246195,"avatar_url":"https://avatars.githubusercontent.com/u/246195?v=3","gravatar_id":"","url":"https://api.github.com/users/bensonby","html_url":"https://github.com/bensonby","followers_url":"https://api.github.com/users/bensonby/followers","following_url":"https://api.github.com/users/bensonby/following{/other_user}","gists_url":"https://api.github.com/users/bensonby/gists{/gist_id}","starred_url":"https://api.github.com/users/bensonby/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bensonby/subscriptions","organizations_url":"https://api.github.com/users/bensonby/orgs","repos_url":"https://api.github.com/users/bensonby/repos","events_url":"https://api.github.com/users/bensonby/events{/privacy}","received_events_url":"https://api.github.com/users/bensonby/received_events","type":"User","site_admin":false}],"milestone":null,"commits_url":"https://api.github.com/repos/SkygearIO/skygear-doc/pulls/156/commits","review_comments_url":"https://api.github.com/repos/SkygearIO/skygear-doc/pulls/156/comments","review_comment_url":"https://api.github.com/repos/SkygearIO/skygear-doc/pulls/comments{/number}","comments_url":"https://api.github.com/repos/SkygearIO/skygear-doc/issues/156/comments","statuses_url":"https://api.github.com/repos/SkygearIO/skygear-doc/statuses/a0b56d901b78df69774fef619bf8512eca9ad54a","head":{"label":"TakLee96:acl","ref":"acl","sha":"a0b56d901b78df69774fef619bf8512eca9ad54a","user":{"login":"TakLee96","id":5365444,"avatar_url":"https://avatars.githubusercontent.com/u/5365444?v=3","gravatar_id":"","url":"https://api.github.com/users/TakLee96","html_url":"https://github.com/TakLee96","followers_url":"https://api.github.com/users/TakLee96/followers","following_url":"https://api.github.com/users/TakLee96/following{/other_user}","gists_url":"https://api.github.com/users/TakLee96/gists{/gist_id}","starred_url":"https://api.github.com/users/TakLee96/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/TakLee96/subscriptions","organizations_url":"https://api.github.com/users/TakLee96/orgs","repos_url":"https://api.github.com/users/TakLee96/repos","events_url":"https://api.github.com/users/TakLee96/events{/privacy}","received_events_url":"https://api.github.com/users/TakLee96/received_events","type":"User","site_admin":false},"repo":{"id":61620442,"name":"skygear-doc","full_name":"TakLee96/skygear-doc","owner":{"login":"TakLee96","id":5365444,"avatar_url":"https://avatars.githubusercontent.com/u/5365444?v=3","gravatar_id":"","url":"https://api.github.com/users/TakLee96","html_url":"https://github.com/TakLee96","followers_url":"https://api.github.com/users/TakLee96/followers","following_url":"https://api.github.com/users/TakLee96/following{/other_user}","gists_url":"https://api.github.com/users/TakLee96/gists{/gist_id}","starred_url":"https://api.github.com/users/TakLee96/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/TakLee96/subscriptions","organizations_url":"https://api.github.com/users/TakLee96/orgs","repos_url":"https://api.github.com/users/TakLee96/repos","events_url":"https://api.github.com/users/TakLee96/events{/privacy}","received_events_url":"https://api.github.com/users/TakLee96/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/TakLee96/skygear-doc","description":"Skygear Doc Site","fork":true,"url":"https://api.github.com/repos/TakLee96/skygear-doc","forks_url":"https://api.github.com/repos/TakLee96/skygear-doc/forks","keys_url":"https://api.github.com/repos/TakLee96/skygear-doc/keys{/key_id}","collaborators_url":"https://api.github.com/repos/TakLee96/skygear-doc/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/TakLee96/skygear-doc/teams","hooks_url":"https://api.github.com/repos/TakLee96/skygear-doc/hooks","issue_events_url":"https://api.github.com/repos/TakLee96/skygear-doc/issues/events{/number}","events_url":"https://api.github.com/repos/TakLee96/skygear-doc/events","assignees_url":"https://api.github.com/repos/TakLee96/skygear-doc/assignees{/user}","branches_url":"https://api.github.com/repos/TakLee96/skygear-doc/branches{/branch}","tags_url":"https://api.github.com/repos/TakLee96/skygear-doc/tags","blobs_url":"https://api.github.com/repos/TakLee96/skygear-doc/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/TakLee96/skygear-doc/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/TakLee96/skygear-doc/git/refs{/sha}","trees_url":"https://api.github.com/repos/TakLee96/skygear-doc/git/trees{/sha}","statuses_url":"https://api.github.com/repos/TakLee96/skygear-doc/statuses/{sha}","languages_url":"https://api.github.com/repos/TakLee96/skygear-doc/languages","stargazers_url":"https://api.github.com/repos/TakLee96/skygear-doc/stargazers","contributors_url":"https://api.github.com/repos/TakLee96/skygear-doc/contributors","subscribers_url":"https://api.github.com/repos/TakLee96/skygear-doc/subscribers","subscription_url":"https://api.github.com/repos/TakLee96/skygear-doc/subscription","commits_url":"https://api.github.com/repos/TakLee96/skygear-doc/commits{/sha}","git_commits_url":"https://api.github.com/repos/TakLee96/skygear-doc/git/commits{/sha}","comments_url":"https://api.github.com/repos/TakLee96/skygear-doc/comments{/number}","issue_comment_url":"https://api.github.com/repos/TakLee96/skygear-doc/issues/comments{/number}","contents_url":"https://api.github.com/repos/TakLee96/skygear-doc/contents/{+path}","compare_url":"https://api.github.com/repos/TakLee96/skygear-doc/compare/{base}...{head}","merges_url":"https://api.github.com/repos/TakLee96/skygear-doc/merges","archive_url":"https://api.github.com/repos/TakLee96/skygear-doc/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/TakLee96/skygear-doc/downloads","issues_url":"https://api.github.com/repos/TakLee96/skygear-doc/issues{/number}","pulls_url":"https://api.github.com/repos/TakLee96/skygear-doc/pulls{/number}","milestones_url":"https://api.github.com/repos/TakLee96/skygear-doc/milestones{/number}","notifications_url":"https://api.github.com/repos/TakLee96/skygear-doc/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/TakLee96/skygear-doc/labels{/name}","releases_url":"https://api.github.com/repos/TakLee96/skygear-doc/releases{/id}","deployments_url":"https://api.github.com/repos/TakLee96/skygear-doc/deployments","created_at":"2016-06-21T09:26:26Z","updated_at":"2016-06-21T09:26:27Z","pushed_at":"2016-07-14T08:11:09Z","git_url":"git://github.com/TakLee96/skygear-doc.git","ssh_url":"git@github.com:TakLee96/skygear-doc.git","clone_url":"https://github.com/TakLee96/skygear-doc.git","svn_url":"https://github.com/TakLee96/skygear-doc","homepage":"https://docs.skygear.io/","size":3904,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"SkygearIO:master","ref":"master","sha":"d34354ededa63cf5f12085f84fb46846e4b705ab","user":{"login":"SkygearIO","id":15025887,"avatar_url":"https://avatars.githubusercontent.com/u/15025887?v=3","gravatar_id":"","url":"https://api.github.com/users/SkygearIO","html_url":"https://github.com/SkygearIO","followers_url":"https://api.github.com/users/SkygearIO/followers","following_url":"https://api.github.com/users/SkygearIO/following{/other_user}","gists_url":"https://api.github.com/users/SkygearIO/gists{/gist_id}","starred_url":"https://api.github.com/users/SkygearIO/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/SkygearIO/subscriptions","organizations_url":"https://api.github.com/users/SkygearIO/orgs","repos_url":"https://api.github.com/users/SkygearIO/repos","events_url":"https://api.github.com/users/SkygearIO/events{/privacy}","received_events_url":"https://api.github.com/users/SkygearIO/received_events","type":"Organization","site_admin":false},"repo":{"id":56206030,"name":"skygear-doc","full_name":"SkygearIO/skygear-doc","owner":{"login":"SkygearIO","id":15025887,"avatar_url":"https://avatars.githubusercontent.com/u/15025887?v=3","gravatar_id":"","url":"https://api.github.com/users/SkygearIO","html_url":"https://github.com/SkygearIO","followers_url":"https://api.github.com/users/SkygearIO/followers","following_url":"https://api.github.com/users/SkygearIO/following{/other_user}","gists_url":"https://api.github.com/users/SkygearIO/gists{/gist_id}","starred_url":"https://api.github.com/users/SkygearIO/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/SkygearIO/subscriptions","organizations_url":"https://api.github.com/users/SkygearIO/orgs","repos_url":"https://api.github.com/users/SkygearIO/repos","events_url":"https://api.github.com/users/SkygearIO/events{/privacy}","received_events_url":"https://api.github.com/users/SkygearIO/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/SkygearIO/skygear-doc","description":"Skygear Doc Site","fork":false,"url":"https://api.github.com/repos/SkygearIO/skygear-doc","forks_url":"https://api.github.com/repos/SkygearIO/skygear-doc/forks","keys_url":"https://api.github.com/repos/SkygearIO/skygear-doc/keys{/key_id}","collaborators_url":"https://api.github.com/repos/SkygearIO/skygear-doc/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/SkygearIO/skygear-doc/teams","hooks_url":"https://api.github.com/repos/SkygearIO/skygear-doc/hooks","issue_events_url":"https://api.github.com/repos/SkygearIO/skygear-doc/issues/events{/number}","events_url":"https://api.github.com/repos/SkygearIO/skygear-doc/events","assignees_url":"https://api.github.com/repos/SkygearIO/skygear-doc/assignees{/user}","branches_url":"https://api.github.com/repos/SkygearIO/skygear-doc/branches{/branch}","tags_url":"https://api.github.com/repos/SkygearIO/skygear-doc/tags","blobs_url":"https://api.github.com/repos/SkygearIO/skygear-doc/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/SkygearIO/skygear-doc/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/SkygearIO/skygear-doc/git/refs{/sha}","trees_url":"https://api.github.com/repos/SkygearIO/skygear-doc/git/trees{/sha}","statuses_url":"https://api.github.com/repos/SkygearIO/skygear-doc/statuses/{sha}","languages_url":"https://api.github.com/repos/SkygearIO/skygear-doc/languages","stargazers_url":"https://api.github.com/repos/SkygearIO/skygear-doc/stargazers","contributors_url":"https://api.github.com/repos/SkygearIO/skygear-doc/contributors","subscribers_url":"https://api.github.com/repos/SkygearIO/skygear-doc/subscribers","subscription_url":"https://api.github.com/repos/SkygearIO/skygear-doc/subscription","commits_url":"https://api.github.com/repos/SkygearIO/skygear-doc/commits{/sha}","git_commits_url":"https://api.github.com/repos/SkygearIO/skygear-doc/git/commits{/sha}","comments_url":"https://api.github.com/repos/SkygearIO/skygear-doc/comments{/number}","issue_comment_url":"https://api.github.com/repos/SkygearIO/skygear-doc/issues/comments{/number}","contents_url":"https://api.github.com/repos/SkygearIO/skygear-doc/contents/{+path}","compare_url":"https://api.github.com/repos/SkygearIO/skygear-doc/compare/{base}...{head}","merges_url":"https://api.github.com/repos/SkygearIO/skygear-doc/merges","archive_url":"https://api.github.com/repos/SkygearIO/skygear-doc/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/SkygearIO/skygear-doc/downloads","issues_url":"https://api.github.com/repos/SkygearIO/skygear-doc/issues{/number}","pulls_url":"https://api.github.com/repos/SkygearIO/skygear-doc/pulls{/number}","milestones_url":"https://api.github.com/repos/SkygearIO/skygear-doc/milestones{/number}","notifications_url":"https://api.github.com/repos/SkygearIO/skygear-doc/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/SkygearIO/skygear-doc/labels{/name}","releases_url":"https://api.github.com/repos/SkygearIO/skygear-doc/releases{/id}","deployments_url":"https://api.github.com/repos/SkygearIO/skygear-doc/deployments","created_at":"2016-04-14T04:00:08Z","updated_at":"2016-06-24T03:27:51Z","pushed_at":"2016-07-14T10:02:49Z","git_url":"git://github.com/SkygearIO/skygear-doc.git","ssh_url":"git@github.com:SkygearIO/skygear-doc.git","clone_url":"https://github.com/SkygearIO/skygear-doc.git","svn_url":"https://github.com/SkygearIO/skygear-doc","homepage":"https://docs.skygear.io/","size":3962,"stargazers_count":2,"watchers_count":2,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":11,"mirror_url":null,"open_issues_count":68,"forks":11,"open_issues":68,"watchers":2,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/SkygearIO/skygear-doc/pulls/156"},"html":{"href":"https://github.com/SkygearIO/skygear-doc/pull/156"},"issue":{"href":"https://api.github.com/repos/SkygearIO/skygear-doc/issues/156"},"comments":{"href":"https://api.github.com/repos/SkygearIO/skygear-doc/issues/156/comments"},"review_comments":{"href":"https://api.github.com/repos/SkygearIO/skygear-doc/pulls/156/comments"},"review_comment":{"href":"https://api.github.com/repos/SkygearIO/skygear-doc/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/SkygearIO/skygear-doc/pulls/156/commits"},"statuses":{"href":"https://api.github.com/repos/SkygearIO/skygear-doc/statuses/a0b56d901b78df69774fef619bf8512eca9ad54a"}}}}
{"actor":{"display_login":"bensonby"}}