mirror of
https://github.com/andwati/zitadel.git
synced 2026-11-18 11:15:12 +00:00
fix(console): project member grants, user grants (#329)
* checkbox color * project grant preview * project grante expandable row * add grant detail component * proto regen * project grant members shared module * fix project grant members dialog * fix create dialog * lint * add avatar colors, meta component styling * light theme * dl report * styles * move grants out of user context, grant detail * i18n grant pipe * lint * user grants * clear expandable view project grants * fix project member routing * fix granted members routing * fix group label * rename project grant * disable zitadel grant members * fix routing user grant creation * rest member writes * ignore case searches * forkjoin observables for project search * fix grant creation with users * fix projectid reference * formfield table style, user grant dynamic load * show key if no displayvalue is set * Delete report.20200630.163913.44081.0.001.json Co-authored-by: Silvan <[email protected]>
This commit is contained in:
@@ -15,6 +15,9 @@ import {
|
||||
ProjectGrantMemberSearchQuery,
|
||||
ProjectGrantMemberSearchRequest,
|
||||
ProjectGrantMemberSearchResponse,
|
||||
ProjectGrantUserGrantID,
|
||||
ProjectGrantUserGrantSearchRequest,
|
||||
ProjectGrantUserGrantUpdate,
|
||||
ProjectRoleAdd,
|
||||
SetPasswordNotificationRequest,
|
||||
UpdateUserAddressRequest,
|
||||
@@ -26,9 +29,12 @@ import {
|
||||
UserEmail,
|
||||
UserGrant,
|
||||
UserGrantCreate,
|
||||
UserGrantID,
|
||||
UserGrantSearchQuery,
|
||||
UserGrantSearchRequest,
|
||||
UserGrantSearchResponse,
|
||||
UserGrantUpdate,
|
||||
UserGrantView,
|
||||
UserID,
|
||||
UserPhone,
|
||||
UserProfile,
|
||||
@@ -367,6 +373,93 @@ export class MgmtUserService {
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
public async searchProjectGrantUserGrants(
|
||||
limit: number,
|
||||
offset: number,
|
||||
queryList?: UserGrantSearchQuery[],
|
||||
): Promise<UserGrantSearchResponse> {
|
||||
const req = new ProjectGrantUserGrantSearchRequest();
|
||||
req.setLimit(limit);
|
||||
req.setOffset(offset);
|
||||
if (queryList) {
|
||||
req.setQueriesList(queryList);
|
||||
}
|
||||
return await this.request(
|
||||
c => c.searchProjectGrantUserGrants,
|
||||
req,
|
||||
f => f,
|
||||
);
|
||||
}
|
||||
|
||||
public async projectGrantUserGrantByID(
|
||||
id: string,
|
||||
userId: string,
|
||||
projectGrantId: string,
|
||||
): Promise<UserGrant> {
|
||||
const req = new ProjectGrantUserGrantID();
|
||||
req.setId(id);
|
||||
req.setUserId(userId);
|
||||
req.setProjectGrantId(projectGrantId);
|
||||
|
||||
return await this.request(
|
||||
c => c.projectGrantUserGrantByID,
|
||||
req,
|
||||
f => f,
|
||||
);
|
||||
}
|
||||
|
||||
public async UserGrantByID(
|
||||
id: string,
|
||||
userId: string,
|
||||
): Promise<UserGrantView> {
|
||||
const req = new UserGrantID();
|
||||
req.setId(id);
|
||||
req.setUserId(userId);
|
||||
|
||||
return await this.request(
|
||||
c => c.userGrantByID,
|
||||
req,
|
||||
f => f,
|
||||
);
|
||||
}
|
||||
|
||||
public async UpdateUserGrant(
|
||||
id: string,
|
||||
userId: string,
|
||||
roleKeysList: string[],
|
||||
): Promise<UserGrant> {
|
||||
const req = new UserGrantUpdate();
|
||||
req.setId(id);
|
||||
req.setRoleKeysList(roleKeysList);
|
||||
req.setUserId(userId);
|
||||
|
||||
return await this.request(
|
||||
c => c.updateUserGrant,
|
||||
req,
|
||||
f => f,
|
||||
);
|
||||
}
|
||||
|
||||
public async updateProjectGrantUserGrant(
|
||||
id: string,
|
||||
roleKeysList: string[],
|
||||
userId: string,
|
||||
projectGrantId: string,
|
||||
): Promise<UserGrant> {
|
||||
const req = new ProjectGrantUserGrantUpdate();
|
||||
req.setId(id);
|
||||
req.setRoleKeysList(roleKeysList);
|
||||
req.setUserId(userId);
|
||||
req.setProjectGrantId(projectGrantId);
|
||||
|
||||
return await this.request(
|
||||
c => c.updateProjectGrantUserGrant,
|
||||
req,
|
||||
f => f,
|
||||
);
|
||||
}
|
||||
|
||||
public async ApplicationChanges(id: string, limit: number, offset: number): Promise<Changes> {
|
||||
const req = new ChangeRequest();
|
||||
req.setId(id);
|
||||
|
||||
@@ -29,6 +29,7 @@ import {
|
||||
ProjectGrantUpdate,
|
||||
ProjectGrantView,
|
||||
ProjectID,
|
||||
ProjectMember,
|
||||
ProjectMemberAdd,
|
||||
ProjectMemberChange,
|
||||
ProjectMemberRemove,
|
||||
@@ -36,6 +37,7 @@ import {
|
||||
ProjectMemberSearchRequest,
|
||||
ProjectMemberSearchResponse,
|
||||
ProjectRoleAdd,
|
||||
ProjectRoleAddBulk,
|
||||
ProjectRoleRemove,
|
||||
ProjectRoleSearchQuery,
|
||||
ProjectRoleSearchRequest,
|
||||
@@ -159,18 +161,6 @@ export class ProjectService {
|
||||
);
|
||||
}
|
||||
|
||||
public async ChangeProjectMember(id: string, userId: string, rolesList: string[]): Promise<Empty> {
|
||||
const req = new ProjectMemberChange();
|
||||
req.setId(id);
|
||||
req.setUserId(userId);
|
||||
req.setRolesList(rolesList);
|
||||
return await this.request(
|
||||
c => c.changeProjectMember,
|
||||
req,
|
||||
f => f,
|
||||
);
|
||||
}
|
||||
|
||||
public async DeactivateProject(projectId: string): Promise<Project> {
|
||||
const req = new ProjectID();
|
||||
req.setId(projectId);
|
||||
@@ -212,9 +202,9 @@ export class ProjectService {
|
||||
);
|
||||
}
|
||||
|
||||
public async AddProjectMember(projectId: string, userId: string, rolesList: string[]): Promise<Empty> {
|
||||
public async AddProjectMember(id: string, userId: string, rolesList: string[]): Promise<Empty> {
|
||||
const req = new ProjectMemberAdd();
|
||||
req.setId(projectId);
|
||||
req.setId(id);
|
||||
req.setUserId(userId);
|
||||
req.setRolesList(rolesList);
|
||||
return await this.request(
|
||||
@@ -224,6 +214,18 @@ export class ProjectService {
|
||||
);
|
||||
}
|
||||
|
||||
public async ChangeProjectMember(id: string, userId: string, rolesList: string[]): Promise<ProjectMember> {
|
||||
const req = new ProjectMemberChange();
|
||||
req.setId(id);
|
||||
req.setUserId(userId);
|
||||
req.setRolesList(rolesList);
|
||||
return await this.request(
|
||||
c => c.changeProjectMember,
|
||||
req,
|
||||
f => f,
|
||||
);
|
||||
}
|
||||
|
||||
public async AddProjectGrantMember(
|
||||
projectId: string,
|
||||
grantId: string,
|
||||
@@ -359,6 +361,20 @@ export class ProjectService {
|
||||
);
|
||||
}
|
||||
|
||||
public async BulkAddProjectRole(
|
||||
id: string,
|
||||
rolesList: ProjectRoleAdd[],
|
||||
): Promise<Empty> {
|
||||
const req = new ProjectRoleAddBulk();
|
||||
req.setId(id);
|
||||
req.setProjectRolesList(rolesList);
|
||||
return await this.request(
|
||||
c => c.bulkAddProjectRole,
|
||||
req,
|
||||
f => f,
|
||||
);
|
||||
}
|
||||
|
||||
public async RemoveProjectRole(projectId: string, key: string): Promise<Empty> {
|
||||
const req = new ProjectRoleRemove();
|
||||
req.setId(projectId);
|
||||
|
||||
Reference in New Issue
Block a user