{"action":"created","comment":{"url":"https://api.github.com/repos/superdesk/liveblog/pulls/comments/50811435","id":50811435,"diff_hunk":"@@ -147,16 +147,18 @@ def on_created(self, docs):\n     def find_one(self, req, **lookup):\n         doc = super().find_one(req, **lookup)\n         # check if the current user has permission to open a blog\n-        if not is_admin(get_user()):\n-            # get members ids\n-            members = [str(m['user']) for m in doc.get('members', [])]\n-            # add owner id to members\n-            members.append(doc.get('original_creator'))\n-            # check if current user belongs to members, and raise an exeption if not\n-            if str(get_user().get('_id')) not in members:\n-                roles = get_resource_service('roles').find_one(req=None, _id=get_user().get('role'))\n-                if not roles:\n-                    raise SuperdeskApiError.forbiddenError(message='you do not have permission to open this blog')\n+        user = get_user()\n+        if user:","path":"server/liveblog/blogs/blogs.py","position":15,"original_position":15,"commit_id":"8ff91d2f6bf87d362b8949aba175768c841701fc","original_commit_id":"8ff91d2f6bf87d362b8949aba175768c841701fc","user":{"login":"ancafarcas","id":6908520,"avatar_url":"https://avatars.githubusercontent.com/u/6908520?v=3","gravatar_id":"","url":"https://api.github.com/users/ancafarcas","html_url":"https://github.com/ancafarcas","followers_url":"https://api.github.com/users/ancafarcas/followers","following_url":"https://api.github.com/users/ancafarcas/following{/other_user}","gists_url":"https://api.github.com/users/ancafarcas/gists{/gist_id}","starred_url":"https://api.github.com/users/ancafarcas/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ancafarcas/subscriptions","organizations_url":"https://api.github.com/users/ancafarcas/orgs","repos_url":"https://api.github.com/users/ancafarcas/repos","events_url":"https://api.github.com/users/ancafarcas/events{/privacy}","received_events_url":"https://api.github.com/users/ancafarcas/received_events","type":"User","site_admin":false},"body":"If there is a not authenticated user, the check-ups for `admin` and `members` of the blog will not take place and they will be able to access the comments since in the comments part we used client_blogs","created_at":"2016-01-26T09:32:46Z","updated_at":"2016-01-26T09:32:46Z","html_url":"https://github.com/superdesk/liveblog/pull/299#discussion_r50811435","pull_request_url":"https://api.github.com/repos/superdesk/liveblog/pulls/299","_links":{"self":{"href":"https://api.github.com/repos/superdesk/liveblog/pulls/comments/50811435"},"html":{"href":"https://github.com/superdesk/liveblog/pull/299#discussion_r50811435"},"pull_request":{"href":"https://api.github.com/repos/superdesk/liveblog/pulls/299"}}},"pull_request":{"url":"https://api.github.com/repos/superdesk/liveblog/pulls/299","id":53514209,"html_url":"https://github.com/superdesk/liveblog/pull/299","diff_url":"https://github.com/superdesk/liveblog/pull/299.diff","patch_url":"https://github.com/superdesk/liveblog/pull/299.patch","issue_url":"https://api.github.com/repos/superdesk/liveblog/issues/299","number":299,"state":"open","locked":false,"title":"Feature/embed comments","user":{"login":"nistormihai","id":836112,"avatar_url":"https://avatars.githubusercontent.com/u/836112?v=3","gravatar_id":"","url":"https://api.github.com/users/nistormihai","html_url":"https://github.com/nistormihai","followers_url":"https://api.github.com/users/nistormihai/followers","following_url":"https://api.github.com/users/nistormihai/following{/other_user}","gists_url":"https://api.github.com/users/nistormihai/gists{/gist_id}","starred_url":"https://api.github.com/users/nistormihai/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nistormihai/subscriptions","organizations_url":"https://api.github.com/users/nistormihai/orgs","repos_url":"https://api.github.com/users/nistormihai/repos","events_url":"https://api.github.com/users/nistormihai/events{/privacy}","received_events_url":"https://api.github.com/users/nistormihai/received_events","type":"User","site_admin":false},"body":"","created_at":"2015-12-14T00:06:02Z","updated_at":"2016-01-26T09:32:46Z","closed_at":null,"merged_at":null,"merge_commit_sha":"9ed0df46ed595900bdd1d58aabd2ea7bfe239f36","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/superdesk/liveblog/pulls/299/commits","review_comments_url":"https://api.github.com/repos/superdesk/liveblog/pulls/299/comments","review_comment_url":"https://api.github.com/repos/superdesk/liveblog/pulls/comments{/number}","comments_url":"https://api.github.com/repos/superdesk/liveblog/issues/299/comments","statuses_url":"https://api.github.com/repos/superdesk/liveblog/statuses/8ff91d2f6bf87d362b8949aba175768c841701fc","head":{"label":"superdesk:feature/embed-comments","ref":"feature/embed-comments","sha":"8ff91d2f6bf87d362b8949aba175768c841701fc","user":{"login":"superdesk","id":5527298,"avatar_url":"https://avatars.githubusercontent.com/u/5527298?v=3","gravatar_id":"","url":"https://api.github.com/users/superdesk","html_url":"https://github.com/superdesk","followers_url":"https://api.github.com/users/superdesk/followers","following_url":"https://api.github.com/users/superdesk/following{/other_user}","gists_url":"https://api.github.com/users/superdesk/gists{/gist_id}","starred_url":"https://api.github.com/users/superdesk/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/superdesk/subscriptions","organizations_url":"https://api.github.com/users/superdesk/orgs","repos_url":"https://api.github.com/users/superdesk/repos","events_url":"https://api.github.com/users/superdesk/events{/privacy}","received_events_url":"https://api.github.com/users/superdesk/received_events","type":"Organization","site_admin":false},"repo":{"id":30958944,"name":"liveblog","full_name":"superdesk/liveblog","owner":{"login":"superdesk","id":5527298,"avatar_url":"https://avatars.githubusercontent.com/u/5527298?v=3","gravatar_id":"","url":"https://api.github.com/users/superdesk","html_url":"https://github.com/superdesk","followers_url":"https://api.github.com/users/superdesk/followers","following_url":"https://api.github.com/users/superdesk/following{/other_user}","gists_url":"https://api.github.com/users/superdesk/gists{/gist_id}","starred_url":"https://api.github.com/users/superdesk/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/superdesk/subscriptions","organizations_url":"https://api.github.com/users/superdesk/orgs","repos_url":"https://api.github.com/users/superdesk/repos","events_url":"https://api.github.com/users/superdesk/events{/privacy}","received_events_url":"https://api.github.com/users/superdesk/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/superdesk/liveblog","description":"Sourcefabric's Live Blog is an open source web app that enables journalists to provide immediate and ongoing coverage on rapidly evolving news events.","fork":false,"url":"https://api.github.com/repos/superdesk/liveblog","forks_url":"https://api.github.com/repos/superdesk/liveblog/forks","keys_url":"https://api.github.com/repos/superdesk/liveblog/keys{/key_id}","collaborators_url":"https://api.github.com/repos/superdesk/liveblog/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/superdesk/liveblog/teams","hooks_url":"https://api.github.com/repos/superdesk/liveblog/hooks","issue_events_url":"https://api.github.com/repos/superdesk/liveblog/issues/events{/number}","events_url":"https://api.github.com/repos/superdesk/liveblog/events","assignees_url":"https://api.github.com/repos/superdesk/liveblog/assignees{/user}","branches_url":"https://api.github.com/repos/superdesk/liveblog/branches{/branch}","tags_url":"https://api.github.com/repos/superdesk/liveblog/tags","blobs_url":"https://api.github.com/repos/superdesk/liveblog/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/superdesk/liveblog/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/superdesk/liveblog/git/refs{/sha}","trees_url":"https://api.github.com/repos/superdesk/liveblog/git/trees{/sha}","statuses_url":"https://api.github.com/repos/superdesk/liveblog/statuses/{sha}","languages_url":"https://api.github.com/repos/superdesk/liveblog/languages","stargazers_url":"https://api.github.com/repos/superdesk/liveblog/stargazers","contributors_url":"https://api.github.com/repos/superdesk/liveblog/contributors","subscribers_url":"https://api.github.com/repos/superdesk/liveblog/subscribers","subscription_url":"https://api.github.com/repos/superdesk/liveblog/subscription","commits_url":"https://api.github.com/repos/superdesk/liveblog/commits{/sha}","git_commits_url":"https://api.github.com/repos/superdesk/liveblog/git/commits{/sha}","comments_url":"https://api.github.com/repos/superdesk/liveblog/comments{/number}","issue_comment_url":"https://api.github.com/repos/superdesk/liveblog/issues/comments{/number}","contents_url":"https://api.github.com/repos/superdesk/liveblog/contents/{+path}","compare_url":"https://api.github.com/repos/superdesk/liveblog/compare/{base}...{head}","merges_url":"https://api.github.com/repos/superdesk/liveblog/merges","archive_url":"https://api.github.com/repos/superdesk/liveblog/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/superdesk/liveblog/downloads","issues_url":"https://api.github.com/repos/superdesk/liveblog/issues{/number}","pulls_url":"https://api.github.com/repos/superdesk/liveblog/pulls{/number}","milestones_url":"https://api.github.com/repos/superdesk/liveblog/milestones{/number}","notifications_url":"https://api.github.com/repos/superdesk/liveblog/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/superdesk/liveblog/labels{/name}","releases_url":"https://api.github.com/repos/superdesk/liveblog/releases{/id}","deployments_url":"https://api.github.com/repos/superdesk/liveblog/deployments","created_at":"2015-02-18T09:22:19Z","updated_at":"2016-01-21T13:29:22Z","pushed_at":"2016-01-26T09:27:45Z","git_url":"git://github.com/superdesk/liveblog.git","ssh_url":"git@github.com:superdesk/liveblog.git","clone_url":"https://github.com/superdesk/liveblog.git","svn_url":"https://github.com/superdesk/liveblog","homepage":"https://www.sourcefabric.org/en/liveblog/","size":5286,"stargazers_count":8,"watchers_count":8,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":10,"mirror_url":null,"open_issues_count":5,"forks":10,"open_issues":5,"watchers":8,"default_branch":"master"}},"base":{"label":"superdesk:devel","ref":"devel","sha":"73850a0760a2976ffba1a33c1a1db348f1a5e6b1","user":{"login":"superdesk","id":5527298,"avatar_url":"https://avatars.githubusercontent.com/u/5527298?v=3","gravatar_id":"","url":"https://api.github.com/users/superdesk","html_url":"https://github.com/superdesk","followers_url":"https://api.github.com/users/superdesk/followers","following_url":"https://api.github.com/users/superdesk/following{/other_user}","gists_url":"https://api.github.com/users/superdesk/gists{/gist_id}","starred_url":"https://api.github.com/users/superdesk/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/superdesk/subscriptions","organizations_url":"https://api.github.com/users/superdesk/orgs","repos_url":"https://api.github.com/users/superdesk/repos","events_url":"https://api.github.com/users/superdesk/events{/privacy}","received_events_url":"https://api.github.com/users/superdesk/received_events","type":"Organization","site_admin":false},"repo":{"id":30958944,"name":"liveblog","full_name":"superdesk/liveblog","owner":{"login":"superdesk","id":5527298,"avatar_url":"https://avatars.githubusercontent.com/u/5527298?v=3","gravatar_id":"","url":"https://api.github.com/users/superdesk","html_url":"https://github.com/superdesk","followers_url":"https://api.github.com/users/superdesk/followers","following_url":"https://api.github.com/users/superdesk/following{/other_user}","gists_url":"https://api.github.com/users/superdesk/gists{/gist_id}","starred_url":"https://api.github.com/users/superdesk/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/superdesk/subscriptions","organizations_url":"https://api.github.com/users/superdesk/orgs","repos_url":"https://api.github.com/users/superdesk/repos","events_url":"https://api.github.com/users/superdesk/events{/privacy}","received_events_url":"https://api.github.com/users/superdesk/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/superdesk/liveblog","description":"Sourcefabric's Live Blog is an open source web app that enables journalists to provide immediate and ongoing coverage on rapidly evolving news events.","fork":false,"url":"https://api.github.com/repos/superdesk/liveblog","forks_url":"https://api.github.com/repos/superdesk/liveblog/forks","keys_url":"https://api.github.com/repos/superdesk/liveblog/keys{/key_id}","collaborators_url":"https://api.github.com/repos/superdesk/liveblog/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/superdesk/liveblog/teams","hooks_url":"https://api.github.com/repos/superdesk/liveblog/hooks","issue_events_url":"https://api.github.com/repos/superdesk/liveblog/issues/events{/number}","events_url":"https://api.github.com/repos/superdesk/liveblog/events","assignees_url":"https://api.github.com/repos/superdesk/liveblog/assignees{/user}","branches_url":"https://api.github.com/repos/superdesk/liveblog/branches{/branch}","tags_url":"https://api.github.com/repos/superdesk/liveblog/tags","blobs_url":"https://api.github.com/repos/superdesk/liveblog/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/superdesk/liveblog/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/superdesk/liveblog/git/refs{/sha}","trees_url":"https://api.github.com/repos/superdesk/liveblog/git/trees{/sha}","statuses_url":"https://api.github.com/repos/superdesk/liveblog/statuses/{sha}","languages_url":"https://api.github.com/repos/superdesk/liveblog/languages","stargazers_url":"https://api.github.com/repos/superdesk/liveblog/stargazers","contributors_url":"https://api.github.com/repos/superdesk/liveblog/contributors","subscribers_url":"https://api.github.com/repos/superdesk/liveblog/subscribers","subscription_url":"https://api.github.com/repos/superdesk/liveblog/subscription","commits_url":"https://api.github.com/repos/superdesk/liveblog/commits{/sha}","git_commits_url":"https://api.github.com/repos/superdesk/liveblog/git/commits{/sha}","comments_url":"https://api.github.com/repos/superdesk/liveblog/comments{/number}","issue_comment_url":"https://api.github.com/repos/superdesk/liveblog/issues/comments{/number}","contents_url":"https://api.github.com/repos/superdesk/liveblog/contents/{+path}","compare_url":"https://api.github.com/repos/superdesk/liveblog/compare/{base}...{head}","merges_url":"https://api.github.com/repos/superdesk/liveblog/merges","archive_url":"https://api.github.com/repos/superdesk/liveblog/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/superdesk/liveblog/downloads","issues_url":"https://api.github.com/repos/superdesk/liveblog/issues{/number}","pulls_url":"https://api.github.com/repos/superdesk/liveblog/pulls{/number}","milestones_url":"https://api.github.com/repos/superdesk/liveblog/milestones{/number}","notifications_url":"https://api.github.com/repos/superdesk/liveblog/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/superdesk/liveblog/labels{/name}","releases_url":"https://api.github.com/repos/superdesk/liveblog/releases{/id}","deployments_url":"https://api.github.com/repos/superdesk/liveblog/deployments","created_at":"2015-02-18T09:22:19Z","updated_at":"2016-01-21T13:29:22Z","pushed_at":"2016-01-26T09:27:45Z","git_url":"git://github.com/superdesk/liveblog.git","ssh_url":"git@github.com:superdesk/liveblog.git","clone_url":"https://github.com/superdesk/liveblog.git","svn_url":"https://github.com/superdesk/liveblog","homepage":"https://www.sourcefabric.org/en/liveblog/","size":5286,"stargazers_count":8,"watchers_count":8,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":10,"mirror_url":null,"open_issues_count":5,"forks":10,"open_issues":5,"watchers":8,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/superdesk/liveblog/pulls/299"},"html":{"href":"https://github.com/superdesk/liveblog/pull/299"},"issue":{"href":"https://api.github.com/repos/superdesk/liveblog/issues/299"},"comments":{"href":"https://api.github.com/repos/superdesk/liveblog/issues/299/comments"},"review_comments":{"href":"https://api.github.com/repos/superdesk/liveblog/pulls/299/comments"},"review_comment":{"href":"https://api.github.com/repos/superdesk/liveblog/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/superdesk/liveblog/pulls/299/commits"},"statuses":{"href":"https://api.github.com/repos/superdesk/liveblog/statuses/8ff91d2f6bf87d362b8949aba175768c841701fc"}}}}