mirror of
https://github.com/paperless-ngx/paperless-ngx.git
synced 2025-10-20 03:06:10 -05:00
Refactor permissions check code
Directly check permissions and no subscription (uisettings is always initialized on frontend startup) update permission directive to accept single string add explicit management permission name
This commit is contained in:
@@ -46,6 +46,7 @@ export abstract class ManagementListComponent<T extends ObjectWithId>
|
||||
protected filterRuleType: number,
|
||||
public typeName: string,
|
||||
public typeNamePlural: string,
|
||||
public permissionName: string,
|
||||
public extraColumns: ManagementListColumn[]
|
||||
) {}
|
||||
|
||||
@@ -60,12 +61,6 @@ export abstract class ManagementListComponent<T extends ObjectWithId>
|
||||
public sortField: string
|
||||
public sortReverse: boolean
|
||||
|
||||
// TODO - Getter used to automatically build a permission name from typeName
|
||||
// Will basically break if permission name is different than typeName
|
||||
public typeNameWithoutWhitespace(): string {
|
||||
return this.typeName.replace(/\s/g, '')
|
||||
}
|
||||
|
||||
private nameFilterDebounce: Subject<string>
|
||||
private subscription: Subscription
|
||||
private _nameFilter: string
|
||||
|
Reference in New Issue
Block a user