Fix mixed rule / owner check, component input / output

This commit is contained in:
shamoon 2023-09-22 01:20:25 -07:00
parent 205106b566
commit 86d223fd93
2 changed files with 5 additions and 1 deletions

View File

@ -21,10 +21,13 @@ export class PermissionsDialogComponent {
this.userService.listAll().subscribe((r) => (this.users = r.results))
}
@Output()
public confirmClicked = new EventEmitter()
@Input()
title = $localize`Set permissions`
@Input()
set object(o: ObjectWithPermissions) {
this.o = o
this.title = $localize`Edit permissions for ` + o['name']
@ -54,6 +57,7 @@ export class PermissionsDialogComponent {
}
}
@Input()
message = $localize`Note that permissions set here will override any existing permissions`
cancelClicked() {

View File

@ -343,7 +343,7 @@
<div class="col">
<div class="btn-group">
<button *pngxIfPermissions="{ action: PermissionAction.Change, type: PermissionType.MailAccount }" [disabled]="!userCanEdit(account)" class="btn btn-sm btn-primary" type="button" (click)="editMailAccount(account)" i18n>Edit</button>
<button *pngxIfOwner="rule" class="btn btn-sm btn-primary" type="button" (click)="editPermissions(account)" i18n>Permissions</button>
<button *pngxIfOwner="account" class="btn btn-sm btn-primary" type="button" (click)="editPermissions(account)" i18n>Permissions</button>
<button *pngxIfPermissions="{ action: PermissionAction.Delete, type: PermissionType.MailAccount }" [disabled]="!userIsOwner(account)" class="btn btn-sm btn-outline-danger" type="button" (click)="deleteMailAccount(account)" i18n>Delete</button>
</div>
</div>