mirror of
https://github.com/andwati/zitadel.git
synced 2026-11-16 02:35:12 +00:00
feat: console feature api (#1480)
This commit is contained in:
@@ -0,0 +1,18 @@
|
||||
import { CommonModule } from '@angular/common';
|
||||
import { NgModule } from '@angular/core';
|
||||
|
||||
import { HasFeaturePipe } from './has-feature.pipe';
|
||||
|
||||
|
||||
@NgModule({
|
||||
declarations: [
|
||||
HasFeaturePipe,
|
||||
],
|
||||
imports: [
|
||||
CommonModule,
|
||||
],
|
||||
exports: [
|
||||
HasFeaturePipe,
|
||||
],
|
||||
})
|
||||
export class HasFeaturePipeModule { }
|
||||
@@ -0,0 +1,14 @@
|
||||
import { Pipe, PipeTransform } from '@angular/core';
|
||||
import { Observable } from 'rxjs';
|
||||
import { GrpcAuthService } from 'src/app/services/grpc-auth.service';
|
||||
|
||||
@Pipe({
|
||||
name: 'hasFeature',
|
||||
})
|
||||
export class HasFeaturePipe implements PipeTransform {
|
||||
constructor(private authService: GrpcAuthService) { }
|
||||
|
||||
public transform(values: string[]): Observable<boolean> {
|
||||
return this.authService.canUseFeature(values);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user