{"action":"created","comment":{"url":"https://api.github.com/repos/Graylog2/graylog2-server/pulls/comments/76205387","id":76205387,"diff_hunk":"@@ -63,22 +66,32 @@ const Decorator = React.createClass({\n \n     return Object.assign({}, config, resolvedConfig);\n   },\n+  _formatActionsMenu() {\n+    const permissions = this.state.currentUser.permissions;\n+    const decorator = this.props.decorator;\n+    const editPermission = this.isPermitted(permissions, `decorators:edit:${decorator.stream}`);\n+    return (\n+      <DropdownButton id={`decorator-${decorator._id}-actions`} bsStyle=\"default\" bsSize=\"xsmall\" title=\"Actions\" pullRight>\n+        <MenuItem onSelect={this._handleEditClick} disabled={!editPermission}>Edit</MenuItem>\n+        <MenuItem divider/>\n+        <MenuItem onSelect={this._handleDeleteClick} disabled={!editPermission}>Delete</MenuItem>\n+      </DropdownButton>\n+    );\n+  },\n   render() {\n-    if (!this.state.types) {\n+    if (!this.state.types || !this.state.currentUser) {\n       return <Spinner />;\n     }\n     const decorator = this.props.decorator;\n     const config = this._resolveConfigurationIds(decorator.config);\n     const decoratorType = this.state.types[decorator.type] || this._decoratorTypeNotPresent();\n+\n+    const decoratorActionsMenu = this._formatActionsMenu();\n     return (\n       <span className={DecoratorStyles.fullWidth}>\n         <div className={DecoratorStyles.decoratorBox}>\n           <h6 className={DecoratorStyles.decoratorType}>{decoratorType.name}</h6>\n-          <DropdownButton id={`decorator-${decorator._id}-actions`} bsStyle=\"default\" bsSize=\"xsmall\" title=\"Actions\" pullRight>\n-            <MenuItem onSelect={this._handleEditClick}>Edit</MenuItem>\n-            <MenuItem divider/>\n-            <MenuItem onSelect={this._handleDeleteClick}>Delete</MenuItem>\n-          </DropdownButton>\n+          {decoratorActionsMenu}","path":"graylog2-web-interface/src/components/search/Decorator.jsx","position":58,"original_position":58,"commit_id":"470a5342e1c76db8ad679c4a6443a3484f1f59ca","original_commit_id":"1460f423dc771307e456d2258bf30344f8fe741b","user":{"login":"edmundoa","id":716185,"avatar_url":"https://avatars.githubusercontent.com/u/716185?v=3","gravatar_id":"","url":"https://api.github.com/users/edmundoa","html_url":"https://github.com/edmundoa","followers_url":"https://api.github.com/users/edmundoa/followers","following_url":"https://api.github.com/users/edmundoa/following{/other_user}","gists_url":"https://api.github.com/users/edmundoa/gists{/gist_id}","starred_url":"https://api.github.com/users/edmundoa/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/edmundoa/subscriptions","organizations_url":"https://api.github.com/users/edmundoa/orgs","repos_url":"https://api.github.com/users/edmundoa/repos","events_url":"https://api.github.com/users/edmundoa/events{/privacy}","received_events_url":"https://api.github.com/users/edmundoa/received_events","type":"User","site_admin":false},"body":"By the way, I didn't want to imply the \"old\" way was the right one, just more consistent with what I had in my head. So 👍 on this from my side.","created_at":"2016-08-25T08:59:55Z","updated_at":"2016-08-25T08:59:55Z","html_url":"https://github.com/Graylog2/graylog2-server/pull/2736#discussion_r76205387","pull_request_url":"https://api.github.com/repos/Graylog2/graylog2-server/pulls/2736","_links":{"self":{"href":"https://api.github.com/repos/Graylog2/graylog2-server/pulls/comments/76205387"},"html":{"href":"https://github.com/Graylog2/graylog2-server/pull/2736#discussion_r76205387"},"pull_request":{"href":"https://api.github.com/repos/Graylog2/graylog2-server/pulls/2736"}}},"pull_request":{"url":"https://api.github.com/repos/Graylog2/graylog2-server/pulls/2736","id":82542102,"html_url":"https://github.com/Graylog2/graylog2-server/pull/2736","diff_url":"https://github.com/Graylog2/graylog2-server/pull/2736.diff","patch_url":"https://github.com/Graylog2/graylog2-server/pull/2736.patch","issue_url":"https://api.github.com/repos/Graylog2/graylog2-server/issues/2736","number":2736,"state":"open","locked":false,"title":"Disable editing controls for decorator if user lacks permissions.","user":{"login":"dennisoelkers","id":41929,"avatar_url":"https://avatars.githubusercontent.com/u/41929?v=3","gravatar_id":"","url":"https://api.github.com/users/dennisoelkers","html_url":"https://github.com/dennisoelkers","followers_url":"https://api.github.com/users/dennisoelkers/followers","following_url":"https://api.github.com/users/dennisoelkers/following{/other_user}","gists_url":"https://api.github.com/users/dennisoelkers/gists{/gist_id}","starred_url":"https://api.github.com/users/dennisoelkers/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dennisoelkers/subscriptions","organizations_url":"https://api.github.com/users/dennisoelkers/orgs","repos_url":"https://api.github.com/users/dennisoelkers/repos","events_url":"https://api.github.com/users/dennisoelkers/events{/privacy}","received_events_url":"https://api.github.com/users/dennisoelkers/received_events","type":"User","site_admin":false},"body":"<!--- Provide a general summary of your changes in the Title above -->\r\n\r\n## Description\r\nThis change does the following when a user lacks the\r\n'decorators:edit:${streamId}' permission:\r\n\r\n  * disables items in action menu, when user lacks\r\n  * disables controls to create decorator\r\n  * disables ability to reorder decorators by drag & drop\r\n\r\nFixes #2730.\r\n\r\n## Types of changes\r\n<!--- What types of changes does your code introduce? Put an `x` in all the boxes that apply: -->\r\n- [x] Bug fix (non-breaking change which fixes an issue)\r\n- [x] New feature (non-breaking change which adds functionality)\r\n- [ ] Breaking change (fix or feature that would cause existing functionality to change)\r\n\r\n## Checklist:\r\n<!--- Go over all the following points, and put an `x` in all the boxes that apply. -->\r\n<!--- If you're unsure about any of these, don't hesitate to ask. We're here to help! -->\r\n- [x] My code follows the code style of this project.\r\n- [ ] My change requires a change to the documentation.\r\n- [ ] I have updated the documentation accordingly.\r\n- [ ] I have read the **CONTRIBUTING** document.\r\n- [ ] I have added tests to cover my changes.\r\n- [x] All new and existing tests passed.\r\n","created_at":"2016-08-24T13:31:04Z","updated_at":"2016-08-25T08:59:55Z","closed_at":null,"merged_at":null,"merge_commit_sha":"90fb5861aa0d640fb3fcf538a9e8a6679c124b48","assignee":{"login":"edmundoa","id":716185,"avatar_url":"https://avatars.githubusercontent.com/u/716185?v=3","gravatar_id":"","url":"https://api.github.com/users/edmundoa","html_url":"https://github.com/edmundoa","followers_url":"https://api.github.com/users/edmundoa/followers","following_url":"https://api.github.com/users/edmundoa/following{/other_user}","gists_url":"https://api.github.com/users/edmundoa/gists{/gist_id}","starred_url":"https://api.github.com/users/edmundoa/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/edmundoa/subscriptions","organizations_url":"https://api.github.com/users/edmundoa/orgs","repos_url":"https://api.github.com/users/edmundoa/repos","events_url":"https://api.github.com/users/edmundoa/events{/privacy}","received_events_url":"https://api.github.com/users/edmundoa/received_events","type":"User","site_admin":false},"assignees":[{"login":"edmundoa","id":716185,"avatar_url":"https://avatars.githubusercontent.com/u/716185?v=3","gravatar_id":"","url":"https://api.github.com/users/edmundoa","html_url":"https://github.com/edmundoa","followers_url":"https://api.github.com/users/edmundoa/followers","following_url":"https://api.github.com/users/edmundoa/following{/other_user}","gists_url":"https://api.github.com/users/edmundoa/gists{/gist_id}","starred_url":"https://api.github.com/users/edmundoa/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/edmundoa/subscriptions","organizations_url":"https://api.github.com/users/edmundoa/orgs","repos_url":"https://api.github.com/users/edmundoa/repos","events_url":"https://api.github.com/users/edmundoa/events{/privacy}","received_events_url":"https://api.github.com/users/edmundoa/received_events","type":"User","site_admin":false}],"milestone":{"url":"https://api.github.com/repos/Graylog2/graylog2-server/milestones/50","html_url":"https://github.com/Graylog2/graylog2-server/milestones/2.1.0","labels_url":"https://api.github.com/repos/Graylog2/graylog2-server/milestones/50/labels","id":1659568,"number":50,"title":"2.1.0","description":"","creator":{"login":"bernd","id":461,"avatar_url":"https://avatars.githubusercontent.com/u/461?v=3","gravatar_id":"","url":"https://api.github.com/users/bernd","html_url":"https://github.com/bernd","followers_url":"https://api.github.com/users/bernd/followers","following_url":"https://api.github.com/users/bernd/following{/other_user}","gists_url":"https://api.github.com/users/bernd/gists{/gist_id}","starred_url":"https://api.github.com/users/bernd/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bernd/subscriptions","organizations_url":"https://api.github.com/users/bernd/orgs","repos_url":"https://api.github.com/users/bernd/repos","events_url":"https://api.github.com/users/bernd/events{/privacy}","received_events_url":"https://api.github.com/users/bernd/received_events","type":"User","site_admin":false},"open_issues":2,"closed_issues":262,"state":"open","created_at":"2016-03-22T12:00:23Z","updated_at":"2016-08-24T16:40:08Z","due_on":null,"closed_at":null},"commits_url":"https://api.github.com/repos/Graylog2/graylog2-server/pulls/2736/commits","review_comments_url":"https://api.github.com/repos/Graylog2/graylog2-server/pulls/2736/comments","review_comment_url":"https://api.github.com/repos/Graylog2/graylog2-server/pulls/comments{/number}","comments_url":"https://api.github.com/repos/Graylog2/graylog2-server/issues/2736/comments","statuses_url":"https://api.github.com/repos/Graylog2/graylog2-server/statuses/470a5342e1c76db8ad679c4a6443a3484f1f59ca","head":{"label":"Graylog2:issue-2730","ref":"issue-2730","sha":"470a5342e1c76db8ad679c4a6443a3484f1f59ca","user":{"login":"Graylog2","id":474892,"avatar_url":"https://avatars.githubusercontent.com/u/474892?v=3","gravatar_id":"","url":"https://api.github.com/users/Graylog2","html_url":"https://github.com/Graylog2","followers_url":"https://api.github.com/users/Graylog2/followers","following_url":"https://api.github.com/users/Graylog2/following{/other_user}","gists_url":"https://api.github.com/users/Graylog2/gists{/gist_id}","starred_url":"https://api.github.com/users/Graylog2/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Graylog2/subscriptions","organizations_url":"https://api.github.com/users/Graylog2/orgs","repos_url":"https://api.github.com/users/Graylog2/repos","events_url":"https://api.github.com/users/Graylog2/events{/privacy}","received_events_url":"https://api.github.com/users/Graylog2/received_events","type":"Organization","site_admin":false},"repo":{"id":671825,"name":"graylog2-server","full_name":"Graylog2/graylog2-server","owner":{"login":"Graylog2","id":474892,"avatar_url":"https://avatars.githubusercontent.com/u/474892?v=3","gravatar_id":"","url":"https://api.github.com/users/Graylog2","html_url":"https://github.com/Graylog2","followers_url":"https://api.github.com/users/Graylog2/followers","following_url":"https://api.github.com/users/Graylog2/following{/other_user}","gists_url":"https://api.github.com/users/Graylog2/gists{/gist_id}","starred_url":"https://api.github.com/users/Graylog2/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Graylog2/subscriptions","organizations_url":"https://api.github.com/users/Graylog2/orgs","repos_url":"https://api.github.com/users/Graylog2/repos","events_url":"https://api.github.com/users/Graylog2/events{/privacy}","received_events_url":"https://api.github.com/users/Graylog2/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/Graylog2/graylog2-server","description":"Free and open source log management","fork":false,"url":"https://api.github.com/repos/Graylog2/graylog2-server","forks_url":"https://api.github.com/repos/Graylog2/graylog2-server/forks","keys_url":"https://api.github.com/repos/Graylog2/graylog2-server/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Graylog2/graylog2-server/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Graylog2/graylog2-server/teams","hooks_url":"https://api.github.com/repos/Graylog2/graylog2-server/hooks","issue_events_url":"https://api.github.com/repos/Graylog2/graylog2-server/issues/events{/number}","events_url":"https://api.github.com/repos/Graylog2/graylog2-server/events","assignees_url":"https://api.github.com/repos/Graylog2/graylog2-server/assignees{/user}","branches_url":"https://api.github.com/repos/Graylog2/graylog2-server/branches{/branch}","tags_url":"https://api.github.com/repos/Graylog2/graylog2-server/tags","blobs_url":"https://api.github.com/repos/Graylog2/graylog2-server/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Graylog2/graylog2-server/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Graylog2/graylog2-server/git/refs{/sha}","trees_url":"https://api.github.com/repos/Graylog2/graylog2-server/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Graylog2/graylog2-server/statuses/{sha}","languages_url":"https://api.github.com/repos/Graylog2/graylog2-server/languages","stargazers_url":"https://api.github.com/repos/Graylog2/graylog2-server/stargazers","contributors_url":"https://api.github.com/repos/Graylog2/graylog2-server/contributors","subscribers_url":"https://api.github.com/repos/Graylog2/graylog2-server/subscribers","subscription_url":"https://api.github.com/repos/Graylog2/graylog2-server/subscription","commits_url":"https://api.github.com/repos/Graylog2/graylog2-server/commits{/sha}","git_commits_url":"https://api.github.com/repos/Graylog2/graylog2-server/git/commits{/sha}","comments_url":"https://api.github.com/repos/Graylog2/graylog2-server/comments{/number}","issue_comment_url":"https://api.github.com/repos/Graylog2/graylog2-server/issues/comments{/number}","contents_url":"https://api.github.com/repos/Graylog2/graylog2-server/contents/{+path}","compare_url":"https://api.github.com/repos/Graylog2/graylog2-server/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Graylog2/graylog2-server/merges","archive_url":"https://api.github.com/repos/Graylog2/graylog2-server/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Graylog2/graylog2-server/downloads","issues_url":"https://api.github.com/repos/Graylog2/graylog2-server/issues{/number}","pulls_url":"https://api.github.com/repos/Graylog2/graylog2-server/pulls{/number}","milestones_url":"https://api.github.com/repos/Graylog2/graylog2-server/milestones{/number}","notifications_url":"https://api.github.com/repos/Graylog2/graylog2-server/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Graylog2/graylog2-server/labels{/name}","releases_url":"https://api.github.com/repos/Graylog2/graylog2-server/releases{/id}","deployments_url":"https://api.github.com/repos/Graylog2/graylog2-server/deployments","created_at":"2010-05-17T21:27:02Z","updated_at":"2016-08-25T07:14:52Z","pushed_at":"2016-08-25T08:55:32Z","git_url":"git://github.com/Graylog2/graylog2-server.git","ssh_url":"git@github.com:Graylog2/graylog2-server.git","clone_url":"https://github.com/Graylog2/graylog2-server.git","svn_url":"https://github.com/Graylog2/graylog2-server","homepage":"https://www.graylog.org/","size":65844,"stargazers_count":2166,"watchers_count":2166,"language":"Java","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":338,"mirror_url":null,"open_issues_count":346,"forks":338,"open_issues":346,"watchers":2166,"default_branch":"master"}},"base":{"label":"Graylog2:master","ref":"master","sha":"79c1d651679fd94f82a09e7c19ed333189bb5f8d","user":{"login":"Graylog2","id":474892,"avatar_url":"https://avatars.githubusercontent.com/u/474892?v=3","gravatar_id":"","url":"https://api.github.com/users/Graylog2","html_url":"https://github.com/Graylog2","followers_url":"https://api.github.com/users/Graylog2/followers","following_url":"https://api.github.com/users/Graylog2/following{/other_user}","gists_url":"https://api.github.com/users/Graylog2/gists{/gist_id}","starred_url":"https://api.github.com/users/Graylog2/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Graylog2/subscriptions","organizations_url":"https://api.github.com/users/Graylog2/orgs","repos_url":"https://api.github.com/users/Graylog2/repos","events_url":"https://api.github.com/users/Graylog2/events{/privacy}","received_events_url":"https://api.github.com/users/Graylog2/received_events","type":"Organization","site_admin":false},"repo":{"id":671825,"name":"graylog2-server","full_name":"Graylog2/graylog2-server","owner":{"login":"Graylog2","id":474892,"avatar_url":"https://avatars.githubusercontent.com/u/474892?v=3","gravatar_id":"","url":"https://api.github.com/users/Graylog2","html_url":"https://github.com/Graylog2","followers_url":"https://api.github.com/users/Graylog2/followers","following_url":"https://api.github.com/users/Graylog2/following{/other_user}","gists_url":"https://api.github.com/users/Graylog2/gists{/gist_id}","starred_url":"https://api.github.com/users/Graylog2/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Graylog2/subscriptions","organizations_url":"https://api.github.com/users/Graylog2/orgs","repos_url":"https://api.github.com/users/Graylog2/repos","events_url":"https://api.github.com/users/Graylog2/events{/privacy}","received_events_url":"https://api.github.com/users/Graylog2/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/Graylog2/graylog2-server","description":"Free and open source log management","fork":false,"url":"https://api.github.com/repos/Graylog2/graylog2-server","forks_url":"https://api.github.com/repos/Graylog2/graylog2-server/forks","keys_url":"https://api.github.com/repos/Graylog2/graylog2-server/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Graylog2/graylog2-server/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Graylog2/graylog2-server/teams","hooks_url":"https://api.github.com/repos/Graylog2/graylog2-server/hooks","issue_events_url":"https://api.github.com/repos/Graylog2/graylog2-server/issues/events{/number}","events_url":"https://api.github.com/repos/Graylog2/graylog2-server/events","assignees_url":"https://api.github.com/repos/Graylog2/graylog2-server/assignees{/user}","branches_url":"https://api.github.com/repos/Graylog2/graylog2-server/branches{/branch}","tags_url":"https://api.github.com/repos/Graylog2/graylog2-server/tags","blobs_url":"https://api.github.com/repos/Graylog2/graylog2-server/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Graylog2/graylog2-server/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Graylog2/graylog2-server/git/refs{/sha}","trees_url":"https://api.github.com/repos/Graylog2/graylog2-server/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Graylog2/graylog2-server/statuses/{sha}","languages_url":"https://api.github.com/repos/Graylog2/graylog2-server/languages","stargazers_url":"https://api.github.com/repos/Graylog2/graylog2-server/stargazers","contributors_url":"https://api.github.com/repos/Graylog2/graylog2-server/contributors","subscribers_url":"https://api.github.com/repos/Graylog2/graylog2-server/subscribers","subscription_url":"https://api.github.com/repos/Graylog2/graylog2-server/subscription","commits_url":"https://api.github.com/repos/Graylog2/graylog2-server/commits{/sha}","git_commits_url":"https://api.github.com/repos/Graylog2/graylog2-server/git/commits{/sha}","comments_url":"https://api.github.com/repos/Graylog2/graylog2-server/comments{/number}","issue_comment_url":"https://api.github.com/repos/Graylog2/graylog2-server/issues/comments{/number}","contents_url":"https://api.github.com/repos/Graylog2/graylog2-server/contents/{+path}","compare_url":"https://api.github.com/repos/Graylog2/graylog2-server/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Graylog2/graylog2-server/merges","archive_url":"https://api.github.com/repos/Graylog2/graylog2-server/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Graylog2/graylog2-server/downloads","issues_url":"https://api.github.com/repos/Graylog2/graylog2-server/issues{/number}","pulls_url":"https://api.github.com/repos/Graylog2/graylog2-server/pulls{/number}","milestones_url":"https://api.github.com/repos/Graylog2/graylog2-server/milestones{/number}","notifications_url":"https://api.github.com/repos/Graylog2/graylog2-server/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Graylog2/graylog2-server/labels{/name}","releases_url":"https://api.github.com/repos/Graylog2/graylog2-server/releases{/id}","deployments_url":"https://api.github.com/repos/Graylog2/graylog2-server/deployments","created_at":"2010-05-17T21:27:02Z","updated_at":"2016-08-25T07:14:52Z","pushed_at":"2016-08-25T08:55:32Z","git_url":"git://github.com/Graylog2/graylog2-server.git","ssh_url":"git@github.com:Graylog2/graylog2-server.git","clone_url":"https://github.com/Graylog2/graylog2-server.git","svn_url":"https://github.com/Graylog2/graylog2-server","homepage":"https://www.graylog.org/","size":65844,"stargazers_count":2166,"watchers_count":2166,"language":"Java","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":338,"mirror_url":null,"open_issues_count":346,"forks":338,"open_issues":346,"watchers":2166,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/Graylog2/graylog2-server/pulls/2736"},"html":{"href":"https://github.com/Graylog2/graylog2-server/pull/2736"},"issue":{"href":"https://api.github.com/repos/Graylog2/graylog2-server/issues/2736"},"comments":{"href":"https://api.github.com/repos/Graylog2/graylog2-server/issues/2736/comments"},"review_comments":{"href":"https://api.github.com/repos/Graylog2/graylog2-server/pulls/2736/comments"},"review_comment":{"href":"https://api.github.com/repos/Graylog2/graylog2-server/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/Graylog2/graylog2-server/pulls/2736/commits"},"statuses":{"href":"https://api.github.com/repos/Graylog2/graylog2-server/statuses/470a5342e1c76db8ad679c4a6443a3484f1f59ca"}}}}
{"actor":{"display_login":"edmundoa"}}