diff options
author | Stas Vilchik <stas.vilchik@sonarsource.com> | 2017-09-05 11:00:00 +0200 |
---|---|---|
committer | Stas Vilchik <stas.vilchik@sonarsource.com> | 2017-09-11 11:28:29 +0200 |
commit | 71fec25c4056c1dcfe75769c2041b1d56a89a2e5 (patch) | |
tree | e640a76709b242652d3cc274a9d0a98f720ae768 /server/sonar-web/src/main/js/api/permissions.ts | |
parent | 0926670e79d919e0afa3f0a2e11f656bdcd05916 (diff) | |
download | sonarqube-71fec25c4056c1dcfe75769c2041b1d56a89a2e5.tar.gz sonarqube-71fec25c4056c1dcfe75769c2041b1d56a89a2e5.zip |
SONAR-9784 rewrite projects management page
Diffstat (limited to 'server/sonar-web/src/main/js/api/permissions.ts')
-rw-r--r-- | server/sonar-web/src/main/js/api/permissions.ts | 28 |
1 files changed, 24 insertions, 4 deletions
diff --git a/server/sonar-web/src/main/js/api/permissions.ts b/server/sonar-web/src/main/js/api/permissions.ts index de6b169104f..5c927bc3692 100644 --- a/server/sonar-web/src/main/js/api/permissions.ts +++ b/server/sonar-web/src/main/js/api/permissions.ts @@ -85,10 +85,30 @@ export function revokePermissionFromGroup( return post('/api/permissions/remove_group', data); } -/** - * Get list of permission templates - */ -export function getPermissionTemplates(organization?: string) { +export interface PermissionTemplate { + id: string; + name: string; + description?: string; + projectKeyPattern?: string; + createdAt: string; + updatedAt?: string; + permissions: Array<{ + key: string; + usersCount: number; + groupsCount: number; + withProjectCreator?: boolean; + }>; +} + +interface GetPermissionTemplatesResponse { + permissionTemplates: PermissionTemplate[]; + defaultTemplates: Array<{ templateId: string; qualifier: string }>; + permissions: Array<{ key: string; name: string; description: string }>; +} + +export function getPermissionTemplates( + organization?: string +): Promise<GetPermissionTemplatesResponse> { const url = '/api/permissions/search_templates'; return organization ? getJSON(url, { organization }) : getJSON(url); } |