From 6ece5240a58d4eeccaf7b5eb7f3ec32bd2dacdf2 Mon Sep 17 00:00:00 2001 From: Michael Shamoon <4887959+shamoon@users.noreply.github.com> Date: Thu, 8 Dec 2022 02:03:50 -0800 Subject: [PATCH] Bulk edit permissions --- src-ui/src/app/app.module.ts | 2 + .../confirm-dialog.component.ts | 2 +- .../permissions-dialog.component.html | 29 ++++ .../permissions-dialog.component.scss | 0 .../permissions-dialog.component.ts | 46 ++++++ .../bulk-editor/bulk-editor.component.html | 8 +- .../bulk-editor/bulk-editor.component.ts | 13 ++ src-ui/src/assets/bootstrap-icons.svg | 2 +- src/documents/bulk_edit.py | 13 ++ src/documents/permissions.py | 70 ++++++++ src/documents/serialisers.py | 154 +++++++----------- src/documents/tests/test_api.py | 27 +++ 12 files changed, 267 insertions(+), 99 deletions(-) create mode 100644 src-ui/src/app/components/common/permissions-dialog/permissions-dialog.component.html create mode 100644 src-ui/src/app/components/common/permissions-dialog/permissions-dialog.component.scss create mode 100644 src-ui/src/app/components/common/permissions-dialog/permissions-dialog.component.ts diff --git a/src-ui/src/app/app.module.ts b/src-ui/src/app/app.module.ts index 9e97ac90b..c6b0c1484 100644 --- a/src-ui/src/app/app.module.ts +++ b/src-ui/src/app/app.module.ts @@ -108,6 +108,7 @@ import localeSr from '@angular/common/locales/sr' import localeSv from '@angular/common/locales/sv' import localeTr from '@angular/common/locales/tr' import localeZh from '@angular/common/locales/zh' +import { PermissionsDialogComponent } from './components/common/permissions-dialog/permissions-dialog.component' registerLocaleData(localeBe) registerLocaleData(localeCs) @@ -203,6 +204,7 @@ function initializeApp(settings: SettingsService) { PermissionsGroupComponent, IfOwnerDirective, IfObjectPermissionsDirective, + PermissionsDialogComponent, ], imports: [ BrowserModule, diff --git a/src-ui/src/app/components/common/confirm-dialog/confirm-dialog.component.ts b/src-ui/src/app/components/common/confirm-dialog/confirm-dialog.component.ts index 59d84bbe8..3cd90f2f4 100644 --- a/src-ui/src/app/components/common/confirm-dialog/confirm-dialog.component.ts +++ b/src-ui/src/app/components/common/confirm-dialog/confirm-dialog.component.ts @@ -1,6 +1,6 @@ import { Component, EventEmitter, Input, Output } from '@angular/core' import { NgbActiveModal } from '@ng-bootstrap/ng-bootstrap' -import { interval, Subject, switchMap, take } from 'rxjs' +import { interval, Subject, take } from 'rxjs' @Component({ selector: 'app-confirm-dialog', diff --git a/src-ui/src/app/components/common/permissions-dialog/permissions-dialog.component.html b/src-ui/src/app/components/common/permissions-dialog/permissions-dialog.component.html new file mode 100644 index 000000000..d169d5dec --- /dev/null +++ b/src-ui/src/app/components/common/permissions-dialog/permissions-dialog.component.html @@ -0,0 +1,29 @@ +