aboutsummaryrefslogtreecommitdiffstats
path: root/server/sonar-web/src/main/js/api/permissions.ts
diff options
context:
space:
mode:
authorStas Vilchik <stas.vilchik@sonarsource.com>2017-09-05 11:00:00 +0200
committerStas Vilchik <stas.vilchik@sonarsource.com>2017-09-11 11:28:29 +0200
commit71fec25c4056c1dcfe75769c2041b1d56a89a2e5 (patch)
treee640a76709b242652d3cc274a9d0a98f720ae768 /server/sonar-web/src/main/js/api/permissions.ts
parent0926670e79d919e0afa3f0a2e11f656bdcd05916 (diff)
downloadsonarqube-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.ts28
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);
}