简体   繁体   中英

SonarQube - SQL Server : get users and groups associated with Project in SonarQube from backend database

I need to find the list of users and group associated with project in SonarQube.

I try to find tables user_roles and group_roles that have a column resource_id . This can be used to get corresponding kee value in table resource_index . This kee value is not same as projects file kee value.

Select * 
into #TempTblSnprjusrs
From 
    (Select 
         users.login "lanid", users.name "Name", resource_index.kee "Kee"
     from 
         user_roles, resource_index, users
     Where 
         resource_index.resource_id = user_roles.resource_id 
         and users.id = user_roles.user_id) as x;

But we cannot get corresponding values of kee in projects table.

Select Distinct 
    #TempTblSnprjusrs.lanid, #TempTblSnprjusrs.Name,                   
    #TempTblSnprjusrs.kee, projects.Name 
from 
    #TempTblSnprjusrs
join 
    projects on projects.kee =  #TempTblSnprjusrs.Project_key;

The database is not an API.

To get the users and groups associated with a project permission-wise, use the Administrative Security interface. Otherwise, you'll want the permissions web services .

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM