mirror of
https://github.com/andwati/zitadel.git
synced 2026-11-04 05:12:16 +00:00
fix(console, login): console - ensure permission is available, login - i18n fixes, input borders, lgn-touched script to add class on blur (#3760)
* permission restriction, member, login i18n input borders, secondary text * add touched js
This commit is contained in:
@@ -6,20 +6,14 @@ import { filter, switchMap } from 'rxjs/operators';
|
||||
import { GrpcAuthService } from '../services/grpc-auth.service';
|
||||
|
||||
@Injectable({
|
||||
providedIn: 'root',
|
||||
providedIn: 'root',
|
||||
})
|
||||
export class RoleGuard implements CanActivate {
|
||||
constructor(private authService: GrpcAuthService) {}
|
||||
|
||||
constructor(private authService: GrpcAuthService) { }
|
||||
|
||||
public canActivate(
|
||||
route: ActivatedRouteSnapshot,
|
||||
state: RouterStateSnapshot,
|
||||
): Observable<boolean> {
|
||||
return this.authService.fetchedZitadelPermissions.pipe(
|
||||
filter((permissionsFetched) => !!permissionsFetched),
|
||||
).pipe(
|
||||
switchMap(_ => this.authService.isAllowed(route.data['roles'])),
|
||||
);
|
||||
}
|
||||
public canActivate(route: ActivatedRouteSnapshot, state: RouterStateSnapshot): Observable<boolean> {
|
||||
return this.authService.fetchedZitadelPermissions
|
||||
.pipe(filter((permissionsFetched) => !!permissionsFetched))
|
||||
.pipe(switchMap((_) => this.authService.isAllowed(route.data['roles'], route.data['requiresAll'])));
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user