mirror of
https://github.com/andwati/zitadel.git
synced 2026-11-28 23:18:54 +00:00
feat(console): set primary domain, fix org create permission (#688)
* feat: set primary domain, fix org perm * lint
This commit is contained in:
@@ -128,6 +128,10 @@ export class GrpcAuthService {
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* returns true if user has one of the provided roles
|
||||
* @param roles roles of the user
|
||||
*/
|
||||
public isAllowed(roles: string[] | RegExp[]): Observable<boolean> {
|
||||
if (roles && roles.length > 0) {
|
||||
return this.zitadelPermissions.pipe(switchMap(zroles => {
|
||||
@@ -138,6 +142,11 @@ export class GrpcAuthService {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* returns true if user has one of the provided roles
|
||||
* @param userRoles roles of the user
|
||||
* @param requestedRoles required roles for accessing the respective component
|
||||
*/
|
||||
public hasRoles(userRoles: string[], requestedRoles: string[] | RegExp[]): boolean {
|
||||
return requestedRoles.findIndex((regexp: any) => {
|
||||
return userRoles.findIndex(role => {
|
||||
|
||||
@@ -63,6 +63,7 @@ import {
|
||||
PasswordLockoutPolicyID,
|
||||
PasswordLockoutPolicyUpdate,
|
||||
PasswordRequest,
|
||||
PrimaryOrgDomainRequest,
|
||||
Project,
|
||||
ProjectCreateRequest,
|
||||
ProjectGrant,
|
||||
@@ -254,6 +255,12 @@ export class ManagementService {
|
||||
return this.grpcService.mgmt.searchMyOrgDomains(req);
|
||||
}
|
||||
|
||||
public async setMyPrimaryOrgDomain(domain: string): Promise<Empty> {
|
||||
const req: PrimaryOrgDomainRequest = new PrimaryOrgDomainRequest();
|
||||
req.setDomain(domain);
|
||||
return this.grpcService.mgmt.setMyPrimaryOrgDomain(req);
|
||||
}
|
||||
|
||||
public async GenerateMyOrgDomainValidation(domain: string, type: OrgDomainValidationType):
|
||||
Promise<OrgDomainValidationResponse> {
|
||||
const req: OrgDomainValidationRequest = new OrgDomainValidationRequest();
|
||||
|
||||
Reference in New Issue
Block a user