From af0a884ee8109dd5ee665d19cab25b682bb0503a Mon Sep 17 00:00:00 2001 From: Thomas Avery <43214426+Thomas-Avery@users.noreply.github.com> Date: Wed, 1 May 2024 11:47:06 -0500 Subject: [PATCH] [SM-910] Migrate service account -> projects tab to new access policy selector (#8572) * Add view, requests and responses * access policy service update * Add read only support to access policy selector * Migrate service account -> projects tab --- .../models/view/access-policy.view.ts | 9 + .../service-account-projects.component.html | 44 +- .../service-account-projects.component.ts | 217 +++++++--- .../access-policy-selector.component.html | 17 +- .../access-policy-selector.component.ts | 45 +- .../access-policy-selector.service.spec.ts | 1 + .../models/ap-item-value.type.ts | 26 ++ .../models/ap-item-view.type.ts | 33 ++ .../access-policies/access-policy.service.ts | 383 +++++++++--------- ...ervice-account-granted-policies.request.ts | 5 + ...ed-policies-permission-details.response.ts | 15 + ...ject-policy-permission-details.response.ts | 14 + 12 files changed, 531 insertions(+), 278 deletions(-) create mode 100644 bitwarden_license/bit-web/src/app/secrets-manager/shared/access-policies/models/requests/service-account-granted-policies.request.ts create mode 100644 bitwarden_license/bit-web/src/app/secrets-manager/shared/access-policies/models/responses/service-account-granted-policies-permission-details.response.ts create mode 100644 bitwarden_license/bit-web/src/app/secrets-manager/shared/access-policies/models/responses/service-account-project-policy-permission-details.response.ts diff --git a/bitwarden_license/bit-web/src/app/secrets-manager/models/view/access-policy.view.ts b/bitwarden_license/bit-web/src/app/secrets-manager/models/view/access-policy.view.ts index 958fe0d48e..18b6994459 100644 --- a/bitwarden_license/bit-web/src/app/secrets-manager/models/view/access-policy.view.ts +++ b/bitwarden_license/bit-web/src/app/secrets-manager/models/view/access-policy.view.ts @@ -58,3 +58,12 @@ export class ServiceAccountPeopleAccessPoliciesView { userAccessPolicies: UserServiceAccountAccessPolicyView[]; groupAccessPolicies: GroupServiceAccountAccessPolicyView[]; } + +export class ServiceAccountProjectPolicyPermissionDetailsView { + accessPolicy: ServiceAccountProjectAccessPolicyView; + hasPermission: boolean; +} + +export class ServiceAccountGrantedPoliciesView { + grantedProjectPolicies: ServiceAccountProjectPolicyPermissionDetailsView[]; +} diff --git a/bitwarden_license/bit-web/src/app/secrets-manager/service-accounts/projects/service-account-projects.component.html b/bitwarden_license/bit-web/src/app/secrets-manager/service-accounts/projects/service-account-projects.component.html index b97c5ef114..623542bd33 100644 --- a/bitwarden_license/bit-web/src/app/secrets-manager/service-accounts/projects/service-account-projects.component.html +++ b/bitwarden_license/bit-web/src/app/secrets-manager/service-accounts/projects/service-account-projects.component.html @@ -1,17 +1,27 @@ -
- {{ "machineAccountProjectsDescription" | i18n }} -
-