Bulk edit permissions

This commit is contained in:
Michael Shamoon
2022-12-08 02:03:50 -08:00
parent 211fbf0cf6
commit 6ece5240a5
12 changed files with 267 additions and 99 deletions

View File

@@ -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()
}
}