Fix: bulk edit object permissions should use permissions object (#4797)

This commit is contained in:
shamoon 2023-12-04 06:40:17 -08:00 committed by GitHub
parent 62c417cd51
commit 80ff5677ea
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 21 additions and 3 deletions

View File

@ -80,7 +80,16 @@ describe('PermissionsDialogComponent', () => {
it('should return permissions', () => {
expect(component.permissions).toEqual({
owner: null,
set_permissions: null,
set_permissions: {
view: {
users: [],
groups: [],
},
change: {
users: [],
groups: [],
},
},
})
component.form.get('permissions_form').setValue(set_permissions)
expect(component.permissions).toEqual(set_permissions)

View File

@ -52,8 +52,17 @@ export class PermissionsDialogComponent {
get permissions() {
return {
owner: this.form.get('permissions_form').value?.owner ?? null,
set_permissions:
this.form.get('permissions_form').value?.set_permissions ?? null,
set_permissions: this.form.get('permissions_form').value
?.set_permissions ?? {
view: {
users: [],
groups: [],
},
change: {
users: [],
groups: [],
},
},
}
}