mirror of
https://github.com/andwati/zitadel.git
synced 2026-11-09 15:45:12 +00:00
feat(console): angular 10, iam settings, timestamp to date pipe, org iam indicator, general gui fixes and i18n (#270)
* prettier member dialog, iam indicator * changes i18n * fix timestamp conversion, timestamp to date pipe * rm create, update iam policy * add iam policy * add iam section, members component * add iam contributors * gen admin protos * iam member search * update angular * update cdk material * add module for iam members * add iam roles to member dialog * home shortcuts * project view, i18n * lint
This commit is contained in:
@@ -1,8 +1,24 @@
|
||||
import { Injectable } from '@angular/core';
|
||||
import { Empty } from 'google-protobuf/google/protobuf/empty_pb';
|
||||
import { Metadata } from 'grpc-web';
|
||||
|
||||
import { AdminServicePromiseClient } from '../proto/generated/admin_grpc_web_pb';
|
||||
import { CreateOrgRequest, CreateUserRequest, OrgSetUpRequest, OrgSetUpResponse } from '../proto/generated/admin_pb';
|
||||
import {
|
||||
AddIamMemberRequest,
|
||||
CreateOrgRequest,
|
||||
CreateUserRequest,
|
||||
IamMember,
|
||||
IamMemberRoles,
|
||||
IamMemberSearchQuery,
|
||||
IamMemberSearchRequest,
|
||||
IamMemberSearchResponse,
|
||||
OrgIamPolicy,
|
||||
OrgIamPolicyID,
|
||||
OrgIamPolicyRequest,
|
||||
OrgSetUpRequest,
|
||||
OrgSetUpResponse,
|
||||
RemoveIamMemberRequest,
|
||||
} from '../proto/generated/admin_pb';
|
||||
import { GrpcBackendService } from './grpc-backend.service';
|
||||
import { GrpcService, RequestFactory, ResponseMapper } from './grpc.service';
|
||||
|
||||
@@ -42,4 +58,114 @@ export class AdminService {
|
||||
f => f,
|
||||
);
|
||||
}
|
||||
|
||||
public async GetIamMemberRoles(): Promise<IamMemberRoles> {
|
||||
return await this.request(
|
||||
c => c.getIamMemberRoles,
|
||||
new Empty(),
|
||||
f => f,
|
||||
);
|
||||
}
|
||||
|
||||
public async SearchIamMembers(
|
||||
limit: number,
|
||||
offset: number,
|
||||
queryList?: IamMemberSearchQuery[],
|
||||
): Promise<IamMemberSearchResponse> {
|
||||
const req = new IamMemberSearchRequest();
|
||||
req.setLimit(limit);
|
||||
req.setOffset(offset);
|
||||
if (queryList) {
|
||||
req.setQueriesList(queryList);
|
||||
}
|
||||
return await this.request(
|
||||
c => c.searchIamMembers,
|
||||
req,
|
||||
f => f,
|
||||
);
|
||||
}
|
||||
|
||||
public async RemoveIamMember(
|
||||
userId: string,
|
||||
): Promise<Empty> {
|
||||
const req = new RemoveIamMemberRequest();
|
||||
req.setUserId(userId);
|
||||
|
||||
return await this.request(
|
||||
c => c.removeIamMember,
|
||||
req,
|
||||
f => f,
|
||||
);
|
||||
}
|
||||
|
||||
public async AddIamMember(
|
||||
userId: string,
|
||||
rolesList: string[],
|
||||
): Promise<IamMember> {
|
||||
const req = new AddIamMemberRequest();
|
||||
req.setUserId(userId);
|
||||
req.setRolesList(rolesList);
|
||||
|
||||
return await this.request(
|
||||
c => c.addIamMember,
|
||||
req,
|
||||
f => f,
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
public async GetOrgIamPolicy(orgId: string): Promise<OrgIamPolicy> {
|
||||
const req = new OrgIamPolicyID();
|
||||
req.setOrgId(orgId);
|
||||
|
||||
return await this.request(
|
||||
c => c.getOrgIamPolicy,
|
||||
req,
|
||||
f => f,
|
||||
);
|
||||
}
|
||||
|
||||
public async CreateOrgIamPolicy(
|
||||
orgId: string,
|
||||
description: string,
|
||||
userLoginMustBeDomain: boolean): Promise<OrgIamPolicy> {
|
||||
const req = new OrgIamPolicyRequest();
|
||||
req.setOrgId(orgId);
|
||||
req.setDescription(description);
|
||||
req.setUserLoginMustBeDomain(userLoginMustBeDomain);
|
||||
|
||||
return await this.request(
|
||||
c => c.createOrgIamPolicy,
|
||||
req,
|
||||
f => f,
|
||||
);
|
||||
}
|
||||
|
||||
public async UpdateOrgIamPolicy(
|
||||
orgId: string,
|
||||
description: string,
|
||||
userLoginMustBeDomain: boolean): Promise<OrgIamPolicy> {
|
||||
const req = new OrgIamPolicyRequest();
|
||||
req.setOrgId(orgId);
|
||||
req.setDescription(description);
|
||||
req.setUserLoginMustBeDomain(userLoginMustBeDomain);
|
||||
|
||||
return await this.request(
|
||||
c => c.updateOrgIamPolicy,
|
||||
req,
|
||||
f => f,
|
||||
);
|
||||
}
|
||||
|
||||
public async deleteOrgIamPolicy(
|
||||
orgId: string,
|
||||
): Promise<Empty> {
|
||||
const req = new OrgIamPolicyID();
|
||||
req.setOrgId(orgId);
|
||||
return await this.request(
|
||||
c => c.deleteOrgIamPolicy,
|
||||
req,
|
||||
f => f,
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -297,6 +297,7 @@ export class AuthUserService {
|
||||
userRoles = ['user.resourceowner'];
|
||||
}
|
||||
this._roleCache = userRoles;
|
||||
console.log(roles);
|
||||
return of(this.hasRoles(userRoles, roles, each));
|
||||
}),
|
||||
);
|
||||
|
||||
@@ -11,6 +11,8 @@ export abstract class StatehandlerService {
|
||||
public abstract initStateHandler(): void;
|
||||
}
|
||||
|
||||
// TODO: Add Angular decorator.
|
||||
// TODO: Add Angular decorator.
|
||||
@Injectable()
|
||||
export class StatehandlerServiceImpl
|
||||
implements StatehandlerService, OnDestroy {
|
||||
|
||||
Reference in New Issue
Block a user