fix object creation, user serialization, user creation

This commit is contained in:
Michael Shamoon
2022-12-09 03:36:24 -08:00
parent 5005f251fb
commit 3e8bbd1dc8
4 changed files with 15 additions and 6 deletions

View File

@@ -52,8 +52,8 @@ export class UserEditDialogComponent
last_name: new FormControl(''),
is_active: new FormControl(true),
is_superuser: new FormControl(false),
groups: new FormControl(null),
user_permissions: new FormControl(null),
groups: new FormControl([]),
user_permissions: new FormControl([]),
})
}

View File

@@ -13,7 +13,7 @@ export interface PermissionsObject {
}
export interface ObjectWithPermissions extends ObjectWithId {
owner?: PaperlessUser
owner?: number
permissions?: PermissionsObject
}

View File

@@ -45,7 +45,7 @@ export class PermissionsService {
}
public currentUserOwnsObject(object: ObjectWithPermissions): boolean {
return !object || !object.owner || object.owner.id === this.currentUser.id
return !object || !object.owner || object.owner === this.currentUser.id
}
public currentUserHasObjectPermissions(