mirror of
https://github.com/bitwarden/browser
synced 2025-12-17 16:53:34 +00:00
[SM-670] Restrict UI actions based on user permission (#5090)
* Restrict UI actions based on user permission * Swap to hiding bulk option without permission * Fix read/write assignment in project service * Filter projects based on permission in dialog * Fix encryption error for updating secret result * Fix spinner (#5182) * Swap to bit-no-items * [SM-699] Projects bulk delete - add bulk confirmation dialog (#5200) * Add bulk confirmation dialog * Code review updates * Code review - load projects * code review - swap to observable * Code review - remove oninit
This commit is contained in:
@@ -1,11 +1,12 @@
|
||||
import { Component } from "@angular/core";
|
||||
import { ActivatedRoute } from "@angular/router";
|
||||
import { combineLatestWith, filter, Observable, startWith, switchMap } from "rxjs";
|
||||
import { combineLatest, combineLatestWith, filter, Observable, startWith, switchMap } from "rxjs";
|
||||
|
||||
import { I18nService } from "@bitwarden/common/abstractions/i18n.service";
|
||||
import { PlatformUtilsService } from "@bitwarden/common/abstractions/platformUtils.service";
|
||||
import { DialogService } from "@bitwarden/components";
|
||||
|
||||
import { ProjectView } from "../../models/view/project.view";
|
||||
import { SecretListView } from "../../models/view/secret-list.view";
|
||||
import {
|
||||
SecretDeleteDialogComponent,
|
||||
@@ -29,6 +30,7 @@ export class ProjectSecretsComponent {
|
||||
|
||||
private organizationId: string;
|
||||
private projectId: string;
|
||||
protected project$: Observable<ProjectView>;
|
||||
|
||||
constructor(
|
||||
private route: ActivatedRoute,
|
||||
@@ -46,6 +48,12 @@ export class ProjectSecretsComponent {
|
||||
startWith(null)
|
||||
);
|
||||
|
||||
this.project$ = combineLatest([this.route.params, currentProjectEdited]).pipe(
|
||||
switchMap(([params, _]) => {
|
||||
return this.projectService.getByProjectId(params.projectId);
|
||||
})
|
||||
);
|
||||
|
||||
this.secrets$ = this.secretService.secret$.pipe(
|
||||
startWith(null),
|
||||
combineLatestWith(this.route.params, currentProjectEdited),
|
||||
|
||||
Reference in New Issue
Block a user