mirror of
https://github.com/andwati/zitadel.git
synced 2026-11-09 15:45:12 +00:00
feat(console): granted project detail (#203)
* granted project detail * support for grantedProjects * getGrantedProjectGrantByIDs * fix grant members bindings * seperate granted from owned project detail * lint * dont show apps on granted projects
This commit is contained in:
@@ -61,13 +61,12 @@ export class OrgService {
|
||||
);
|
||||
}
|
||||
|
||||
public async SearchOrgMembers(orgId: string, limit: number, offset: number): Promise<OrgMemberSearchResponse> {
|
||||
public async SearchMyOrgMembers(limit: number, offset: number): Promise<OrgMemberSearchResponse> {
|
||||
const req = new OrgMemberSearchRequest();
|
||||
req.setOrgId(orgId);
|
||||
req.setLimit(limit);
|
||||
req.setOffset(offset);
|
||||
return await this.request(
|
||||
c => c.searchOrgMembers,
|
||||
c => c.searchMyOrgMembers,
|
||||
req,
|
||||
f => f,
|
||||
);
|
||||
@@ -83,26 +82,24 @@ export class OrgService {
|
||||
);
|
||||
}
|
||||
|
||||
public async AddOrgMember(orgId: string, userId: string, rolesList: string[]): Promise<Empty> {
|
||||
public async AddMyOrgMember(userId: string, rolesList: string[]): Promise<Empty> {
|
||||
const req = new AddOrgMemberRequest();
|
||||
req.setOrgId(orgId);
|
||||
req.setUserId(userId);
|
||||
if (rolesList) {
|
||||
req.setRolesList(rolesList);
|
||||
}
|
||||
return await this.request(
|
||||
c => c.addOrgMember,
|
||||
c => c.addMyOrgMember,
|
||||
req,
|
||||
f => f,
|
||||
);
|
||||
}
|
||||
|
||||
public async RemoveOrgMember(orgId: string, userId: string): Promise<Empty> {
|
||||
public async RemoveMyOrgMember(userId: string): Promise<Empty> {
|
||||
const req = new RemoveOrgMemberRequest();
|
||||
req.setOrgId(orgId);
|
||||
req.setUserId(userId);
|
||||
return await this.request(
|
||||
c => c.removeOrgMember,
|
||||
c => c.removeMyOrgMember,
|
||||
req,
|
||||
f => f,
|
||||
);
|
||||
|
||||
@@ -10,6 +10,7 @@ import {
|
||||
ApplicationSearchRequest,
|
||||
ApplicationSearchResponse,
|
||||
ApplicationUpdate,
|
||||
GrantedProject,
|
||||
GrantedProjectSearchQuery,
|
||||
GrantedProjectSearchRequest,
|
||||
GrantedProjectSearchResponse,
|
||||
@@ -28,6 +29,7 @@ import {
|
||||
ProjectGrantMemberSearchRequest,
|
||||
ProjectGrantSearchRequest,
|
||||
ProjectGrantSearchResponse,
|
||||
ProjectGrantUpdate,
|
||||
ProjectID,
|
||||
ProjectMemberAdd,
|
||||
ProjectMemberChange,
|
||||
@@ -111,7 +113,7 @@ export class ProjectService {
|
||||
);
|
||||
}
|
||||
|
||||
public async GetGrantedProjectGrantByID(projectId: string, id: string): Promise<ProjectGrant> {
|
||||
public async GetGrantedProjectGrantByID(projectId: string, id: string): Promise<GrantedProject> {
|
||||
const req = new ProjectGrantID();
|
||||
req.setId(id);
|
||||
req.setProjectId(projectId);
|
||||
@@ -143,6 +145,18 @@ export class ProjectService {
|
||||
);
|
||||
}
|
||||
|
||||
public async UpdateProjectGrant(id: string, projectId: string, rolesList: string[]): Promise<ProjectGrant> {
|
||||
const req = new ProjectGrantUpdate();
|
||||
req.setRoleKeysList(rolesList);
|
||||
req.setId(id);
|
||||
req.setProjectId(projectId);
|
||||
return await this.request(
|
||||
c => c.updateProjectGrant,
|
||||
req,
|
||||
f => f,
|
||||
);
|
||||
}
|
||||
|
||||
public async ChangeProjectMember(id: string, userId: string, rolesList: string[]): Promise<Empty> {
|
||||
const req = new ProjectMemberChange();
|
||||
req.setId(id);
|
||||
@@ -196,6 +210,18 @@ export class ProjectService {
|
||||
);
|
||||
}
|
||||
|
||||
public async AddProjectMember(projectId: string, userId: string, rolesList: string[]): Promise<Empty> {
|
||||
const req = new ProjectMemberAdd();
|
||||
req.setId(projectId);
|
||||
req.setUserId(userId);
|
||||
req.setRolesList(rolesList);
|
||||
return await this.request(
|
||||
c => c.addProjectMember,
|
||||
req,
|
||||
f => f,
|
||||
);
|
||||
}
|
||||
|
||||
public async AddProjectGrantMember(
|
||||
projectId: string,
|
||||
grantId: string,
|
||||
@@ -499,16 +525,4 @@ export class ProjectService {
|
||||
f => f,
|
||||
);
|
||||
}
|
||||
|
||||
public async AddProjectMember(projectId: string, userId: string, rolesList: string[]): Promise<Empty> {
|
||||
const req = new ProjectMemberAdd();
|
||||
req.setId(projectId);
|
||||
req.setUserId(userId);
|
||||
req.setRolesList(rolesList);
|
||||
return await this.request(
|
||||
c => c.addProjectMember,
|
||||
req,
|
||||
f => f,
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user