{"action":"created","comment":{"url":"https://api.github.com/repos/dmwm/WMCore/pulls/comments/58062575","id":58062575,"diff_hunk":"@@ -0,0 +1,22 @@\n+from __future__ import print_function, division\n+\n+ALL_ROLES = ['developer', 'admin', 'data-manager', 'production-operator', 'web-service']\n+ALL_GROUP = ['reqmgr', 'facops', 'dataops']\n+ADMIN_ROLES = ['admin', 'web-service']\n+ADMIN_GROUP = ['reqmgr', 'facops']\n+\n+ADMIN_PERMISSION = {'role': ADMIN_ROLES, 'group': ADMIN_GROUP}\n+DEFAULT_STATUS_PERMISSION = {'role': ALL_ROLES, 'group': ALL_GROUP}\n+\n+\n+PERMISSION_BY_REQUEST_TYPE = {\n+    \"ADMIIN\" : ADMIN_PERMISSION,\n+    \"NOSTATUS\":  ADMIN_PERMISSION, # permmission for updating the values without updating status\n+    \"DEFAULT_STATUS\": DEFAULT_STATUS_PERMISSION, # permmission for updating the status change\n+    \"DEFAULT_TYPE\": {\"new\": DEFAULT_STATUS_PERMISSION,\n+                     \"assign-approved\": DEFAULT_STATUS_PERMISSION,                               \n+                     \"assigned\": DEFAULT_STATUS_PERMISSION},                         \n+    \"StoreResult\" : {\"new\": DEFAULT_STATUS_PERMISSION,\n+                     \"assign-approved\": DEFAULT_STATUS_PERMISSION,                               ","path":"src/python/WMCore/ReqMgr/DataStructs/DefaultConfig/PERMISSION_BY_REQUEST_TYPE.py","position":20,"original_position":20,"commit_id":"c29f3c1b482db2b2b90b9c5db031837f418e6079","original_commit_id":"c29f3c1b482db2b2b90b9c5db031837f418e6079","user":{"login":"ticoann","id":1247993,"avatar_url":"https://avatars.githubusercontent.com/u/1247993?v=3","gravatar_id":"","url":"https://api.github.com/users/ticoann","html_url":"https://github.com/ticoann","followers_url":"https://api.github.com/users/ticoann/followers","following_url":"https://api.github.com/users/ticoann/following{/other_user}","gists_url":"https://api.github.com/users/ticoann/gists{/gist_id}","starred_url":"https://api.github.com/users/ticoann/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ticoann/subscriptions","organizations_url":"https://api.github.com/users/ticoann/orgs","repos_url":"https://api.github.com/users/ticoann/repos","events_url":"https://api.github.com/users/ticoann/events{/privacy}","received_events_url":"https://api.github.com/users/ticoann/received_events","type":"User","site_admin":false},"body":"updated, I guess it wasn't giving me error since it falls in the default anyway. This permission need to be refined.","created_at":"2016-03-31T14:26:30Z","updated_at":"2016-03-31T14:26:30Z","html_url":"https://github.com/dmwm/WMCore/pull/6762#discussion_r58062575","pull_request_url":"https://api.github.com/repos/dmwm/WMCore/pulls/6762","_links":{"self":{"href":"https://api.github.com/repos/dmwm/WMCore/pulls/comments/58062575"},"html":{"href":"https://github.com/dmwm/WMCore/pull/6762#discussion_r58062575"},"pull_request":{"href":"https://api.github.com/repos/dmwm/WMCore/pulls/6762"}}},"pull_request":{"url":"https://api.github.com/repos/dmwm/WMCore/pulls/6762","id":64704799,"html_url":"https://github.com/dmwm/WMCore/pull/6762","diff_url":"https://github.com/dmwm/WMCore/pull/6762.diff","patch_url":"https://github.com/dmwm/WMCore/pull/6762.patch","issue_url":"https://api.github.com/repos/dmwm/WMCore/issues/6762","number":6762,"state":"open","locked":false,"title":"create framework for config which can be controlled in runtime","user":{"login":"ticoann","id":1247993,"avatar_url":"https://avatars.githubusercontent.com/u/1247993?v=3","gravatar_id":"","url":"https://api.github.com/users/ticoann","html_url":"https://github.com/ticoann","followers_url":"https://api.github.com/users/ticoann/followers","following_url":"https://api.github.com/users/ticoann/following{/other_user}","gists_url":"https://api.github.com/users/ticoann/gists{/gist_id}","starred_url":"https://api.github.com/users/ticoann/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ticoann/subscriptions","organizations_url":"https://api.github.com/users/ticoann/orgs","repos_url":"https://api.github.com/users/ticoann/repos","events_url":"https://api.github.com/users/ticoann/events{/privacy}","received_events_url":"https://api.github.com/users/ticoann/received_events","type":"User","site_admin":false},"body":"This is the framework for ops script migration. (Ops can control the configuration file for closed-out, assign, etc)\r\n\r\nCurrently,\r\n1. permission by the role, DAS result filter, splitting algo editable field are used in the cache.\r\n2. It will always connect couchdb to get the result if couchdb is temporary unavailable, it will get the result from cache.\r\n3. Only the (config) document  with default values is set will be able to updated.\r\n\r\nStill need to have, \r\n1. control the roles and groups which can update the config.\r\n2. content of config need to be validated. \r\n3. automatic register by adding config in the WMCore.ReqMgr.DatatStruct.DefaultConfig without explicitly importing it.\r\n4. config only can be replaced not updated (should we add update function?)\r\n","created_at":"2016-03-30T22:02:04Z","updated_at":"2016-03-31T14:26:30Z","closed_at":null,"merged_at":null,"merge_commit_sha":"b49ba2e1218a4da98051050d30a09739bfeea49b","assignee":{"login":"ticoann","id":1247993,"avatar_url":"https://avatars.githubusercontent.com/u/1247993?v=3","gravatar_id":"","url":"https://api.github.com/users/ticoann","html_url":"https://github.com/ticoann","followers_url":"https://api.github.com/users/ticoann/followers","following_url":"https://api.github.com/users/ticoann/following{/other_user}","gists_url":"https://api.github.com/users/ticoann/gists{/gist_id}","starred_url":"https://api.github.com/users/ticoann/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ticoann/subscriptions","organizations_url":"https://api.github.com/users/ticoann/orgs","repos_url":"https://api.github.com/users/ticoann/repos","events_url":"https://api.github.com/users/ticoann/events{/privacy}","received_events_url":"https://api.github.com/users/ticoann/received_events","type":"User","site_admin":false},"milestone":{"url":"https://api.github.com/repos/dmwm/WMCore/milestones/122","html_url":"https://github.com/dmwm/WMCore/milestones/WMAgent1603","labels_url":"https://api.github.com/repos/dmwm/WMCore/milestones/122/labels","id":1335175,"number":122,"title":"WMAgent1603","description":"","creator":{"login":"ticoann","id":1247993,"avatar_url":"https://avatars.githubusercontent.com/u/1247993?v=3","gravatar_id":"","url":"https://api.github.com/users/ticoann","html_url":"https://github.com/ticoann","followers_url":"https://api.github.com/users/ticoann/followers","following_url":"https://api.github.com/users/ticoann/following{/other_user}","gists_url":"https://api.github.com/users/ticoann/gists{/gist_id}","starred_url":"https://api.github.com/users/ticoann/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ticoann/subscriptions","organizations_url":"https://api.github.com/users/ticoann/orgs","repos_url":"https://api.github.com/users/ticoann/repos","events_url":"https://api.github.com/users/ticoann/events{/privacy}","received_events_url":"https://api.github.com/users/ticoann/received_events","type":"User","site_admin":false},"open_issues":19,"closed_issues":54,"state":"open","created_at":"2015-10-02T16:27:39Z","updated_at":"2016-03-31T14:11:51Z","due_on":"2016-03-31T05:00:00Z","closed_at":null},"commits_url":"https://api.github.com/repos/dmwm/WMCore/pulls/6762/commits","review_comments_url":"https://api.github.com/repos/dmwm/WMCore/pulls/6762/comments","review_comment_url":"https://api.github.com/repos/dmwm/WMCore/pulls/comments{/number}","comments_url":"https://api.github.com/repos/dmwm/WMCore/issues/6762/comments","statuses_url":"https://api.github.com/repos/dmwm/WMCore/statuses/c29f3c1b482db2b2b90b9c5db031837f418e6079","head":{"label":"ticoann:reqmgr2_cache","ref":"reqmgr2_cache","sha":"c29f3c1b482db2b2b90b9c5db031837f418e6079","user":{"login":"ticoann","id":1247993,"avatar_url":"https://avatars.githubusercontent.com/u/1247993?v=3","gravatar_id":"","url":"https://api.github.com/users/ticoann","html_url":"https://github.com/ticoann","followers_url":"https://api.github.com/users/ticoann/followers","following_url":"https://api.github.com/users/ticoann/following{/other_user}","gists_url":"https://api.github.com/users/ticoann/gists{/gist_id}","starred_url":"https://api.github.com/users/ticoann/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ticoann/subscriptions","organizations_url":"https://api.github.com/users/ticoann/orgs","repos_url":"https://api.github.com/users/ticoann/repos","events_url":"https://api.github.com/users/ticoann/events{/privacy}","received_events_url":"https://api.github.com/users/ticoann/received_events","type":"User","site_admin":false},"repo":{"id":2935076,"name":"WMCore","full_name":"ticoann/WMCore","owner":{"login":"ticoann","id":1247993,"avatar_url":"https://avatars.githubusercontent.com/u/1247993?v=3","gravatar_id":"","url":"https://api.github.com/users/ticoann","html_url":"https://github.com/ticoann","followers_url":"https://api.github.com/users/ticoann/followers","following_url":"https://api.github.com/users/ticoann/following{/other_user}","gists_url":"https://api.github.com/users/ticoann/gists{/gist_id}","starred_url":"https://api.github.com/users/ticoann/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ticoann/subscriptions","organizations_url":"https://api.github.com/users/ticoann/orgs","repos_url":"https://api.github.com/users/ticoann/repos","events_url":"https://api.github.com/users/ticoann/events{/privacy}","received_events_url":"https://api.github.com/users/ticoann/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/ticoann/WMCore","description":"WMCore","fork":true,"url":"https://api.github.com/repos/ticoann/WMCore","forks_url":"https://api.github.com/repos/ticoann/WMCore/forks","keys_url":"https://api.github.com/repos/ticoann/WMCore/keys{/key_id}","collaborators_url":"https://api.github.com/repos/ticoann/WMCore/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/ticoann/WMCore/teams","hooks_url":"https://api.github.com/repos/ticoann/WMCore/hooks","issue_events_url":"https://api.github.com/repos/ticoann/WMCore/issues/events{/number}","events_url":"https://api.github.com/repos/ticoann/WMCore/events","assignees_url":"https://api.github.com/repos/ticoann/WMCore/assignees{/user}","branches_url":"https://api.github.com/repos/ticoann/WMCore/branches{/branch}","tags_url":"https://api.github.com/repos/ticoann/WMCore/tags","blobs_url":"https://api.github.com/repos/ticoann/WMCore/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/ticoann/WMCore/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/ticoann/WMCore/git/refs{/sha}","trees_url":"https://api.github.com/repos/ticoann/WMCore/git/trees{/sha}","statuses_url":"https://api.github.com/repos/ticoann/WMCore/statuses/{sha}","languages_url":"https://api.github.com/repos/ticoann/WMCore/languages","stargazers_url":"https://api.github.com/repos/ticoann/WMCore/stargazers","contributors_url":"https://api.github.com/repos/ticoann/WMCore/contributors","subscribers_url":"https://api.github.com/repos/ticoann/WMCore/subscribers","subscription_url":"https://api.github.com/repos/ticoann/WMCore/subscription","commits_url":"https://api.github.com/repos/ticoann/WMCore/commits{/sha}","git_commits_url":"https://api.github.com/repos/ticoann/WMCore/git/commits{/sha}","comments_url":"https://api.github.com/repos/ticoann/WMCore/comments{/number}","issue_comment_url":"https://api.github.com/repos/ticoann/WMCore/issues/comments{/number}","contents_url":"https://api.github.com/repos/ticoann/WMCore/contents/{+path}","compare_url":"https://api.github.com/repos/ticoann/WMCore/compare/{base}...{head}","merges_url":"https://api.github.com/repos/ticoann/WMCore/merges","archive_url":"https://api.github.com/repos/ticoann/WMCore/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/ticoann/WMCore/downloads","issues_url":"https://api.github.com/repos/ticoann/WMCore/issues{/number}","pulls_url":"https://api.github.com/repos/ticoann/WMCore/pulls{/number}","milestones_url":"https://api.github.com/repos/ticoann/WMCore/milestones{/number}","notifications_url":"https://api.github.com/repos/ticoann/WMCore/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/ticoann/WMCore/labels{/name}","releases_url":"https://api.github.com/repos/ticoann/WMCore/releases{/id}","deployments_url":"https://api.github.com/repos/ticoann/WMCore/deployments","created_at":"2011-12-07T19:34:12Z","updated_at":"2014-06-21T11:18:43Z","pushed_at":"2016-03-31T04:47:51Z","git_url":"git://github.com/ticoann/WMCore.git","ssh_url":"git@github.com:ticoann/WMCore.git","clone_url":"https://github.com/ticoann/WMCore.git","svn_url":"https://github.com/ticoann/WMCore","homepage":"https://svnweb.cern.ch/trac/CMSDMWM/","size":26551,"stargazers_count":3,"watchers_count":3,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":3,"mirror_url":null,"open_issues_count":1,"forks":3,"open_issues":1,"watchers":3,"default_branch":"master"}},"base":{"label":"dmwm:master","ref":"master","sha":"c9d15c850970122edcb743e554bc959777625522","user":{"login":"dmwm","id":988897,"avatar_url":"https://avatars.githubusercontent.com/u/988897?v=3","gravatar_id":"","url":"https://api.github.com/users/dmwm","html_url":"https://github.com/dmwm","followers_url":"https://api.github.com/users/dmwm/followers","following_url":"https://api.github.com/users/dmwm/following{/other_user}","gists_url":"https://api.github.com/users/dmwm/gists{/gist_id}","starred_url":"https://api.github.com/users/dmwm/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dmwm/subscriptions","organizations_url":"https://api.github.com/users/dmwm/orgs","repos_url":"https://api.github.com/users/dmwm/repos","events_url":"https://api.github.com/users/dmwm/events{/privacy}","received_events_url":"https://api.github.com/users/dmwm/received_events","type":"Organization","site_admin":false},"repo":{"id":2370458,"name":"WMCore","full_name":"dmwm/WMCore","owner":{"login":"dmwm","id":988897,"avatar_url":"https://avatars.githubusercontent.com/u/988897?v=3","gravatar_id":"","url":"https://api.github.com/users/dmwm","html_url":"https://github.com/dmwm","followers_url":"https://api.github.com/users/dmwm/followers","following_url":"https://api.github.com/users/dmwm/following{/other_user}","gists_url":"https://api.github.com/users/dmwm/gists{/gist_id}","starred_url":"https://api.github.com/users/dmwm/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dmwm/subscriptions","organizations_url":"https://api.github.com/users/dmwm/orgs","repos_url":"https://api.github.com/users/dmwm/repos","events_url":"https://api.github.com/users/dmwm/events{/privacy}","received_events_url":"https://api.github.com/users/dmwm/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/dmwm/WMCore","description":"WMCore","fork":false,"url":"https://api.github.com/repos/dmwm/WMCore","forks_url":"https://api.github.com/repos/dmwm/WMCore/forks","keys_url":"https://api.github.com/repos/dmwm/WMCore/keys{/key_id}","collaborators_url":"https://api.github.com/repos/dmwm/WMCore/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/dmwm/WMCore/teams","hooks_url":"https://api.github.com/repos/dmwm/WMCore/hooks","issue_events_url":"https://api.github.com/repos/dmwm/WMCore/issues/events{/number}","events_url":"https://api.github.com/repos/dmwm/WMCore/events","assignees_url":"https://api.github.com/repos/dmwm/WMCore/assignees{/user}","branches_url":"https://api.github.com/repos/dmwm/WMCore/branches{/branch}","tags_url":"https://api.github.com/repos/dmwm/WMCore/tags","blobs_url":"https://api.github.com/repos/dmwm/WMCore/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/dmwm/WMCore/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/dmwm/WMCore/git/refs{/sha}","trees_url":"https://api.github.com/repos/dmwm/WMCore/git/trees{/sha}","statuses_url":"https://api.github.com/repos/dmwm/WMCore/statuses/{sha}","languages_url":"https://api.github.com/repos/dmwm/WMCore/languages","stargazers_url":"https://api.github.com/repos/dmwm/WMCore/stargazers","contributors_url":"https://api.github.com/repos/dmwm/WMCore/contributors","subscribers_url":"https://api.github.com/repos/dmwm/WMCore/subscribers","subscription_url":"https://api.github.com/repos/dmwm/WMCore/subscription","commits_url":"https://api.github.com/repos/dmwm/WMCore/commits{/sha}","git_commits_url":"https://api.github.com/repos/dmwm/WMCore/git/commits{/sha}","comments_url":"https://api.github.com/repos/dmwm/WMCore/comments{/number}","issue_comment_url":"https://api.github.com/repos/dmwm/WMCore/issues/comments{/number}","contents_url":"https://api.github.com/repos/dmwm/WMCore/contents/{+path}","compare_url":"https://api.github.com/repos/dmwm/WMCore/compare/{base}...{head}","merges_url":"https://api.github.com/repos/dmwm/WMCore/merges","archive_url":"https://api.github.com/repos/dmwm/WMCore/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/dmwm/WMCore/downloads","issues_url":"https://api.github.com/repos/dmwm/WMCore/issues{/number}","pulls_url":"https://api.github.com/repos/dmwm/WMCore/pulls{/number}","milestones_url":"https://api.github.com/repos/dmwm/WMCore/milestones{/number}","notifications_url":"https://api.github.com/repos/dmwm/WMCore/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/dmwm/WMCore/labels{/name}","releases_url":"https://api.github.com/repos/dmwm/WMCore/releases{/id}","deployments_url":"https://api.github.com/repos/dmwm/WMCore/deployments","created_at":"2011-09-12T10:37:21Z","updated_at":"2016-02-24T13:44:36Z","pushed_at":"2016-03-31T14:11:51Z","git_url":"git://github.com/dmwm/WMCore.git","ssh_url":"git@github.com:dmwm/WMCore.git","clone_url":"https://github.com/dmwm/WMCore.git","svn_url":"https://github.com/dmwm/WMCore","homepage":"https://svnweb.cern.ch/trac/CMSDMWM/","size":29308,"stargazers_count":25,"watchers_count":25,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":51,"mirror_url":null,"open_issues_count":388,"forks":51,"open_issues":388,"watchers":25,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/dmwm/WMCore/pulls/6762"},"html":{"href":"https://github.com/dmwm/WMCore/pull/6762"},"issue":{"href":"https://api.github.com/repos/dmwm/WMCore/issues/6762"},"comments":{"href":"https://api.github.com/repos/dmwm/WMCore/issues/6762/comments"},"review_comments":{"href":"https://api.github.com/repos/dmwm/WMCore/pulls/6762/comments"},"review_comment":{"href":"https://api.github.com/repos/dmwm/WMCore/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/dmwm/WMCore/pulls/6762/commits"},"statuses":{"href":"https://api.github.com/repos/dmwm/WMCore/statuses/c29f3c1b482db2b2b90b9c5db031837f418e6079"}}}}