{"action":"created","comment":{"url":"https://api.github.com/repos/IMQS/imqsauth/pulls/comments/23146728","id":23146728,"diff_hunk":"@@ -373,6 +375,55 @@ func httpHandlerCreateUser(central *ImqsCentral, w http.ResponseWriter, r *httpR\n \t}\n }\n \n+func httpHandlerCreateGroup(central *ImqsCentral, w http.ResponseWriter, r *httpRequest) {\n+\tgroupname := strings.TrimSpace(r.http.URL.Query().Get(\"groupname\"))\n+\tif groupname == \"\" {\n+\t\tauthaus.HttpSendTxt(w, http.StatusNotAcceptable, \"Group name may not be blank.\")\n+\t\treturn\n+\t}\n+\n+\tif _, error := authaus.LoadOrCreateGroup(central.Central, groupname, true); error == nil {\n+\t\tcentral.Central.Log.Printf(\"New group added: '\" + groupname + \"'\")\n+\t\tauthaus.HttpSendTxt(w, http.StatusOK, \"Group created ('\"+groupname+\"')\")\n+\t\treturn\n+\t} else {\n+\t\tcentral.Central.Log.Printf(\"Error creating group ('\" + groupname + \"') \")\n+\t\tauthaus.HttpSendTxt(w, http.StatusBadRequest, \"Error creating group ('\"+groupname+\"') \")\n+\t\treturn\n+\t}\n+}\n+\n+func httpHandlerSetGroupRoles(central *ImqsCentral, w http.ResponseWriter, r *httpRequest) {\n+\t//TODO : Add check so current user cannot remove own Admin rights\n+\tgroupname := strings.TrimSpace(r.http.URL.Query().Get(\"groupname\"))\n+\trolesstring := strings.TrimSpace(r.http.URL.Query().Get(\"roles\"))\n+\n+\troles := strings.Split(rolesstring, \",\")","path":"imqsauth/http.go","position":36,"original_position":36,"commit_id":"1483da01109f53d5437923e44c48f2a2729d2a71","original_commit_id":"1483da01109f53d5437923e44c48f2a2729d2a71","user":{"login":"benharper123","id":876013,"avatar_url":"https://avatars.githubusercontent.com/u/876013?v=3","gravatar_id":"","url":"https://api.github.com/users/benharper123","html_url":"https://github.com/benharper123","followers_url":"https://api.github.com/users/benharper123/followers","following_url":"https://api.github.com/users/benharper123/following{/other_user}","gists_url":"https://api.github.com/users/benharper123/gists{/gist_id}","starred_url":"https://api.github.com/users/benharper123/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/benharper123/subscriptions","organizations_url":"https://api.github.com/users/benharper123/orgs","repos_url":"https://api.github.com/users/benharper123/repos","events_url":"https://api.github.com/users/benharper123/events{/privacy}","received_events_url":"https://api.github.com/users/benharper123/received_events","type":"User","site_admin":false},"body":"You don't really need 'roles', you can just pass 'strings.Split(rolesstring, \",\")' in to the for loop.","created_at":"2015-01-19T08:11:15Z","updated_at":"2015-01-19T08:11:15Z","html_url":"https://github.com/IMQS/imqsauth/pull/3#discussion_r23146728","pull_request_url":"https://api.github.com/repos/IMQS/imqsauth/pulls/3","_links":{"self":{"href":"https://api.github.com/repos/IMQS/imqsauth/pulls/comments/23146728"},"html":{"href":"https://github.com/IMQS/imqsauth/pull/3#discussion_r23146728"},"pull_request":{"href":"https://api.github.com/repos/IMQS/imqsauth/pulls/3"}}},"pull_request":{"url":"https://api.github.com/repos/IMQS/imqsauth/pulls/3","id":27509427,"html_url":"https://github.com/IMQS/imqsauth/pull/3","diff_url":"https://github.com/IMQS/imqsauth/pull/3.diff","patch_url":"https://github.com/IMQS/imqsauth/pull/3.patch","issue_url":"https://api.github.com/repos/IMQS/imqsauth/issues/3","number":3,"state":"open","locked":false,"title":"Http add group","user":{"login":"bosvos","id":2437699,"avatar_url":"https://avatars.githubusercontent.com/u/2437699?v=3","gravatar_id":"","url":"https://api.github.com/users/bosvos","html_url":"https://github.com/bosvos","followers_url":"https://api.github.com/users/bosvos/followers","following_url":"https://api.github.com/users/bosvos/following{/other_user}","gists_url":"https://api.github.com/users/bosvos/gists{/gist_id}","starred_url":"https://api.github.com/users/bosvos/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bosvos/subscriptions","organizations_url":"https://api.github.com/users/bosvos/orgs","repos_url":"https://api.github.com/users/bosvos/repos","events_url":"https://api.github.com/users/bosvos/events{/privacy}","received_events_url":"https://api.github.com/users/bosvos/received_events","type":"User","site_admin":false},"body":"","created_at":"2015-01-16T14:42:17Z","updated_at":"2015-01-19T08:11:15Z","closed_at":null,"merged_at":null,"merge_commit_sha":"f22f2f6de6bc9519cc2b5b14d557422bdf0f38fb","assignee":{"login":"benharper123","id":876013,"avatar_url":"https://avatars.githubusercontent.com/u/876013?v=3","gravatar_id":"","url":"https://api.github.com/users/benharper123","html_url":"https://github.com/benharper123","followers_url":"https://api.github.com/users/benharper123/followers","following_url":"https://api.github.com/users/benharper123/following{/other_user}","gists_url":"https://api.github.com/users/benharper123/gists{/gist_id}","starred_url":"https://api.github.com/users/benharper123/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/benharper123/subscriptions","organizations_url":"https://api.github.com/users/benharper123/orgs","repos_url":"https://api.github.com/users/benharper123/repos","events_url":"https://api.github.com/users/benharper123/events{/privacy}","received_events_url":"https://api.github.com/users/benharper123/received_events","type":"User","site_admin":false},"milestone":null,"commits_url":"https://api.github.com/repos/IMQS/imqsauth/pulls/3/commits","review_comments_url":"https://api.github.com/repos/IMQS/imqsauth/pulls/3/comments","review_comment_url":"https://api.github.com/repos/IMQS/imqsauth/pulls/comments/{number}","comments_url":"https://api.github.com/repos/IMQS/imqsauth/issues/3/comments","statuses_url":"https://api.github.com/repos/IMQS/imqsauth/statuses/1483da01109f53d5437923e44c48f2a2729d2a71","head":{"label":"IMQS:HttpAddGroup","ref":"HttpAddGroup","sha":"1483da01109f53d5437923e44c48f2a2729d2a71","user":{"login":"IMQS","id":2345243,"avatar_url":"https://avatars.githubusercontent.com/u/2345243?v=3","gravatar_id":"","url":"https://api.github.com/users/IMQS","html_url":"https://github.com/IMQS","followers_url":"https://api.github.com/users/IMQS/followers","following_url":"https://api.github.com/users/IMQS/following{/other_user}","gists_url":"https://api.github.com/users/IMQS/gists{/gist_id}","starred_url":"https://api.github.com/users/IMQS/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/IMQS/subscriptions","organizations_url":"https://api.github.com/users/IMQS/orgs","repos_url":"https://api.github.com/users/IMQS/repos","events_url":"https://api.github.com/users/IMQS/events{/privacy}","received_events_url":"https://api.github.com/users/IMQS/received_events","type":"Organization","site_admin":false},"repo":{"id":10231089,"name":"imqsauth","full_name":"IMQS/imqsauth","owner":{"login":"IMQS","id":2345243,"avatar_url":"https://avatars.githubusercontent.com/u/2345243?v=3","gravatar_id":"","url":"https://api.github.com/users/IMQS","html_url":"https://github.com/IMQS","followers_url":"https://api.github.com/users/IMQS/followers","following_url":"https://api.github.com/users/IMQS/following{/other_user}","gists_url":"https://api.github.com/users/IMQS/gists{/gist_id}","starred_url":"https://api.github.com/users/IMQS/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/IMQS/subscriptions","organizations_url":"https://api.github.com/users/IMQS/orgs","repos_url":"https://api.github.com/users/IMQS/repos","events_url":"https://api.github.com/users/IMQS/events{/privacy}","received_events_url":"https://api.github.com/users/IMQS/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/IMQS/imqsauth","description":"IMQS Authentication","fork":false,"url":"https://api.github.com/repos/IMQS/imqsauth","forks_url":"https://api.github.com/repos/IMQS/imqsauth/forks","keys_url":"https://api.github.com/repos/IMQS/imqsauth/keys{/key_id}","collaborators_url":"https://api.github.com/repos/IMQS/imqsauth/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/IMQS/imqsauth/teams","hooks_url":"https://api.github.com/repos/IMQS/imqsauth/hooks","issue_events_url":"https://api.github.com/repos/IMQS/imqsauth/issues/events{/number}","events_url":"https://api.github.com/repos/IMQS/imqsauth/events","assignees_url":"https://api.github.com/repos/IMQS/imqsauth/assignees{/user}","branches_url":"https://api.github.com/repos/IMQS/imqsauth/branches{/branch}","tags_url":"https://api.github.com/repos/IMQS/imqsauth/tags","blobs_url":"https://api.github.com/repos/IMQS/imqsauth/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/IMQS/imqsauth/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/IMQS/imqsauth/git/refs{/sha}","trees_url":"https://api.github.com/repos/IMQS/imqsauth/git/trees{/sha}","statuses_url":"https://api.github.com/repos/IMQS/imqsauth/statuses/{sha}","languages_url":"https://api.github.com/repos/IMQS/imqsauth/languages","stargazers_url":"https://api.github.com/repos/IMQS/imqsauth/stargazers","contributors_url":"https://api.github.com/repos/IMQS/imqsauth/contributors","subscribers_url":"https://api.github.com/repos/IMQS/imqsauth/subscribers","subscription_url":"https://api.github.com/repos/IMQS/imqsauth/subscription","commits_url":"https://api.github.com/repos/IMQS/imqsauth/commits{/sha}","git_commits_url":"https://api.github.com/repos/IMQS/imqsauth/git/commits{/sha}","comments_url":"https://api.github.com/repos/IMQS/imqsauth/comments{/number}","issue_comment_url":"https://api.github.com/repos/IMQS/imqsauth/issues/comments/{number}","contents_url":"https://api.github.com/repos/IMQS/imqsauth/contents/{+path}","compare_url":"https://api.github.com/repos/IMQS/imqsauth/compare/{base}...{head}","merges_url":"https://api.github.com/repos/IMQS/imqsauth/merges","archive_url":"https://api.github.com/repos/IMQS/imqsauth/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/IMQS/imqsauth/downloads","issues_url":"https://api.github.com/repos/IMQS/imqsauth/issues{/number}","pulls_url":"https://api.github.com/repos/IMQS/imqsauth/pulls{/number}","milestones_url":"https://api.github.com/repos/IMQS/imqsauth/milestones{/number}","notifications_url":"https://api.github.com/repos/IMQS/imqsauth/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/IMQS/imqsauth/labels{/name}","releases_url":"https://api.github.com/repos/IMQS/imqsauth/releases{/id}","created_at":"2013-05-22T22:23:06Z","updated_at":"2014-11-25T13:42:41Z","pushed_at":"2015-01-16T14:17:19Z","git_url":"git://github.com/IMQS/imqsauth.git","ssh_url":"git@github.com:IMQS/imqsauth.git","clone_url":"https://github.com/IMQS/imqsauth.git","svn_url":"https://github.com/IMQS/imqsauth","homepage":null,"size":398,"stargazers_count":0,"watchers_count":0,"language":"Go","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1,"mirror_url":null,"open_issues_count":1,"forks":1,"open_issues":1,"watchers":0,"default_branch":"master"}},"base":{"label":"IMQS:master","ref":"master","sha":"4d82c44628c3d08783c62145acf3da0140b6f671","user":{"login":"IMQS","id":2345243,"avatar_url":"https://avatars.githubusercontent.com/u/2345243?v=3","gravatar_id":"","url":"https://api.github.com/users/IMQS","html_url":"https://github.com/IMQS","followers_url":"https://api.github.com/users/IMQS/followers","following_url":"https://api.github.com/users/IMQS/following{/other_user}","gists_url":"https://api.github.com/users/IMQS/gists{/gist_id}","starred_url":"https://api.github.com/users/IMQS/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/IMQS/subscriptions","organizations_url":"https://api.github.com/users/IMQS/orgs","repos_url":"https://api.github.com/users/IMQS/repos","events_url":"https://api.github.com/users/IMQS/events{/privacy}","received_events_url":"https://api.github.com/users/IMQS/received_events","type":"Organization","site_admin":false},"repo":{"id":10231089,"name":"imqsauth","full_name":"IMQS/imqsauth","owner":{"login":"IMQS","id":2345243,"avatar_url":"https://avatars.githubusercontent.com/u/2345243?v=3","gravatar_id":"","url":"https://api.github.com/users/IMQS","html_url":"https://github.com/IMQS","followers_url":"https://api.github.com/users/IMQS/followers","following_url":"https://api.github.com/users/IMQS/following{/other_user}","gists_url":"https://api.github.com/users/IMQS/gists{/gist_id}","starred_url":"https://api.github.com/users/IMQS/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/IMQS/subscriptions","organizations_url":"https://api.github.com/users/IMQS/orgs","repos_url":"https://api.github.com/users/IMQS/repos","events_url":"https://api.github.com/users/IMQS/events{/privacy}","received_events_url":"https://api.github.com/users/IMQS/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/IMQS/imqsauth","description":"IMQS Authentication","fork":false,"url":"https://api.github.com/repos/IMQS/imqsauth","forks_url":"https://api.github.com/repos/IMQS/imqsauth/forks","keys_url":"https://api.github.com/repos/IMQS/imqsauth/keys{/key_id}","collaborators_url":"https://api.github.com/repos/IMQS/imqsauth/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/IMQS/imqsauth/teams","hooks_url":"https://api.github.com/repos/IMQS/imqsauth/hooks","issue_events_url":"https://api.github.com/repos/IMQS/imqsauth/issues/events{/number}","events_url":"https://api.github.com/repos/IMQS/imqsauth/events","assignees_url":"https://api.github.com/repos/IMQS/imqsauth/assignees{/user}","branches_url":"https://api.github.com/repos/IMQS/imqsauth/branches{/branch}","tags_url":"https://api.github.com/repos/IMQS/imqsauth/tags","blobs_url":"https://api.github.com/repos/IMQS/imqsauth/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/IMQS/imqsauth/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/IMQS/imqsauth/git/refs{/sha}","trees_url":"https://api.github.com/repos/IMQS/imqsauth/git/trees{/sha}","statuses_url":"https://api.github.com/repos/IMQS/imqsauth/statuses/{sha}","languages_url":"https://api.github.com/repos/IMQS/imqsauth/languages","stargazers_url":"https://api.github.com/repos/IMQS/imqsauth/stargazers","contributors_url":"https://api.github.com/repos/IMQS/imqsauth/contributors","subscribers_url":"https://api.github.com/repos/IMQS/imqsauth/subscribers","subscription_url":"https://api.github.com/repos/IMQS/imqsauth/subscription","commits_url":"https://api.github.com/repos/IMQS/imqsauth/commits{/sha}","git_commits_url":"https://api.github.com/repos/IMQS/imqsauth/git/commits{/sha}","comments_url":"https://api.github.com/repos/IMQS/imqsauth/comments{/number}","issue_comment_url":"https://api.github.com/repos/IMQS/imqsauth/issues/comments/{number}","contents_url":"https://api.github.com/repos/IMQS/imqsauth/contents/{+path}","compare_url":"https://api.github.com/repos/IMQS/imqsauth/compare/{base}...{head}","merges_url":"https://api.github.com/repos/IMQS/imqsauth/merges","archive_url":"https://api.github.com/repos/IMQS/imqsauth/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/IMQS/imqsauth/downloads","issues_url":"https://api.github.com/repos/IMQS/imqsauth/issues{/number}","pulls_url":"https://api.github.com/repos/IMQS/imqsauth/pulls{/number}","milestones_url":"https://api.github.com/repos/IMQS/imqsauth/milestones{/number}","notifications_url":"https://api.github.com/repos/IMQS/imqsauth/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/IMQS/imqsauth/labels{/name}","releases_url":"https://api.github.com/repos/IMQS/imqsauth/releases{/id}","created_at":"2013-05-22T22:23:06Z","updated_at":"2014-11-25T13:42:41Z","pushed_at":"2015-01-16T14:17:19Z","git_url":"git://github.com/IMQS/imqsauth.git","ssh_url":"git@github.com:IMQS/imqsauth.git","clone_url":"https://github.com/IMQS/imqsauth.git","svn_url":"https://github.com/IMQS/imqsauth","homepage":null,"size":398,"stargazers_count":0,"watchers_count":0,"language":"Go","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1,"mirror_url":null,"open_issues_count":1,"forks":1,"open_issues":1,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/IMQS/imqsauth/pulls/3"},"html":{"href":"https://github.com/IMQS/imqsauth/pull/3"},"issue":{"href":"https://api.github.com/repos/IMQS/imqsauth/issues/3"},"comments":{"href":"https://api.github.com/repos/IMQS/imqsauth/issues/3/comments"},"review_comments":{"href":"https://api.github.com/repos/IMQS/imqsauth/pulls/3/comments"},"review_comment":{"href":"https://api.github.com/repos/IMQS/imqsauth/pulls/comments/{number}"},"commits":{"href":"https://api.github.com/repos/IMQS/imqsauth/pulls/3/commits"},"statuses":{"href":"https://api.github.com/repos/IMQS/imqsauth/statuses/1483da01109f53d5437923e44c48f2a2729d2a71"}}}}