mirror of
https://github.com/paperless-ngx/paperless-ngx.git
synced 2025-09-14 21:45:37 -05:00
Support edit permissions for mail rules and accounts
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
import { Component, EventEmitter, Input, Output } from '@angular/core'
|
||||
import { FormControl, FormGroup } from '@angular/forms'
|
||||
import { NgbActiveModal } from '@ng-bootstrap/ng-bootstrap'
|
||||
import { ObjectWithPermissions } from 'src/app/data/object-with-permissions'
|
||||
import { PaperlessUser } from 'src/app/data/paperless-user'
|
||||
import { UserService } from 'src/app/services/rest/user.service'
|
||||
|
||||
@@ -11,6 +12,7 @@ import { UserService } from 'src/app/services/rest/user.service'
|
||||
})
|
||||
export class PermissionsDialogComponent {
|
||||
users: PaperlessUser[]
|
||||
private o: ObjectWithPermissions = undefined
|
||||
|
||||
constructor(
|
||||
public activeModal: NgbActiveModal,
|
||||
@@ -19,11 +21,24 @@ export class PermissionsDialogComponent {
|
||||
this.userService.listAll().subscribe((r) => (this.users = r.results))
|
||||
}
|
||||
|
||||
@Output()
|
||||
public confirmClicked = new EventEmitter()
|
||||
|
||||
@Input()
|
||||
title = $localize`Set Permissions`
|
||||
title = $localize`Set permissions`
|
||||
|
||||
set object(o: ObjectWithPermissions) {
|
||||
this.o = o
|
||||
this.title = $localize`Edit permissions for ` + o['name']
|
||||
this.form.patchValue({
|
||||
permissions_form: {
|
||||
owner: o.owner,
|
||||
set_permissions: o.permissions,
|
||||
},
|
||||
})
|
||||
}
|
||||
|
||||
get object(): ObjectWithPermissions {
|
||||
return this.o
|
||||
}
|
||||
|
||||
form = new FormGroup({
|
||||
permissions_form: new FormControl(),
|
||||
@@ -39,7 +54,6 @@ export class PermissionsDialogComponent {
|
||||
}
|
||||
}
|
||||
|
||||
@Input()
|
||||
message = $localize`Note that permissions set here will override any existing permissions`
|
||||
|
||||
cancelClicked() {
|
||||
|
Reference in New Issue
Block a user