mirror of
https://github.com/paperless-ngx/paperless-ngx.git
synced 2025-12-11 09:07:18 +01:00
Support edit permissions for mail rules and accounts
This commit is contained in:
parent
54099d8441
commit
205106b566
8 changed files with 273 additions and 108 deletions
|
|
@ -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() {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue