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:
Max Peintner
2022-06-07 09:25:56 +00:00
committed by GitHub
parent c1f59c7950
commit 233d80502d
30 changed files with 333 additions and 71 deletions
+7 -13
View File
@@ -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'])));
}
}