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 @@ + + + diff --git a/src-ui/src/app/components/common/permissions-dialog/permissions-dialog.component.scss b/src-ui/src/app/components/common/permissions-dialog/permissions-dialog.component.scss new file mode 100644 index 000000000..e69de29bb diff --git a/src-ui/src/app/components/common/permissions-dialog/permissions-dialog.component.ts b/src-ui/src/app/components/common/permissions-dialog/permissions-dialog.component.ts new file mode 100644 index 000000000..f00d5ebea --- /dev/null +++ b/src-ui/src/app/components/common/permissions-dialog/permissions-dialog.component.ts @@ -0,0 +1,46 @@ +import { Component, EventEmitter, Input, OnInit, Output } from '@angular/core' +import { FormControl, FormGroup } from '@angular/forms' +import { NgbActiveModal } from '@ng-bootstrap/ng-bootstrap' +import { PaperlessGroup } from 'src/app/data/paperless-group' +import { PaperlessUser } from 'src/app/data/paperless-user' + +@Component({ + selector: 'app-permissions-dialog', + templateUrl: './permissions-dialog.component.html', + styleUrls: ['./permissions-dialog.component.scss'], +}) +export class PermissionsDialogComponent implements OnInit { + constructor(public activeModal: NgbActiveModal) {} + + @Output() + public confirmClicked = new EventEmitter() + + @Input() + title = $localize`Set Permissions` + + form = new FormGroup({ + set_permissions: new FormGroup({ + view: new FormGroup({ + users: new FormControl([]), + groups: new FormControl([]), + }), + change: new FormGroup({ + users: new FormControl([]), + groups: new FormControl([]), + }), + }), + }) + + get permissions() { + return this.form.value['set_permissions'] + } + + @Input() + message = $localize`Note that permissions set here will override any existing permissions` + + ngOnInit(): void {} + + cancelClicked() { + this.activeModal.close() + } +} diff --git a/src-ui/src/app/components/document-list/bulk-editor/bulk-editor.component.html b/src-ui/src/app/components/document-list/bulk-editor/bulk-editor.component.html index 21cd61c5c..2b6209dda 100644 --- a/src-ui/src/app/components/document-list/bulk-editor/bulk-editor.component.html +++ b/src-ui/src/app/components/document-list/bulk-editor/bulk-editor.component.html @@ -65,7 +65,13 @@
-
+
+ +