项目权限managenebt的sonarqube api / permission / add_group

时间:2016-10-12 03:07:48

标签: sonarqube

请告知我对Sonarqube的api电话我做错了什么。

=>要为grp1提供myproj的issueadmin权限,我运行了以下命令

  1. curl -u admin:admin -X POST' http://jsbin.com/bamasobuti/1/edit?html,js,output'
  2.   {"errors":[{"msg":"The 'permission' parameter for global permissions 
    must be one of admin, profileadmin, gateadmin, shareDashboard, scan, 
    provisioning. 'issueadmin' was passed."}]}
    
    1. curl -u admin:admin -X POST' http://localhost:9000/api/permissions/add_group?projectkey=mykey;groupId=4;permission=issueadmin'
    2. {"errors":[{"msg":"The 'permission' parameter for global permissions must be 
      one of admin, profileadmin, gateadmin, shareDashboard, scan, provisioning.
       'issueadmin' was passed."}]}
      

      groupid = 4;

      groupname = grp1

      项目名称= myproj;

      项目ID = 4;

      项目密钥= mykey

1 个答案:

答案 0 :(得分:3)

查看api/permissions/add_group文档(here)。您收到的有关全局权限的错误消息,因此项目密钥无法正确解释。仔细观察参数:

  

projectKey - 可选 - 项目密钥

这是错字。您已使用projectkey代替projectKey

但是,您的网址还有另一个问题:您使用;分隔参数而不是标准&。总而言之,这应该可以解决问题:

  

curl -u admin:admin -X POST' http://localhost:9000/api/permissions/add_group?projectKey=mykey&groupId=4&permission=issueadmin'