mirror of
https://github.com/paperless-ngx/paperless-ngx.git
synced 2025-07-30 18:27:45 -05:00
feat: reflect django permissions on UI
This commit is contained in:
@@ -11,7 +11,7 @@ import {
|
||||
} from '@angular/core'
|
||||
import { Meta } from '@angular/platform-browser'
|
||||
import { CookieService } from 'ngx-cookie-service'
|
||||
import { first, Observable, tap } from 'rxjs'
|
||||
import { first, Observable, of, tap } from 'rxjs'
|
||||
import {
|
||||
BRIGHTNESS,
|
||||
estimateBrightnessForColor,
|
||||
@@ -45,6 +45,7 @@ export class SettingsService {
|
||||
protected baseUrl: string = environment.apiBaseUrl + 'ui_settings/'
|
||||
|
||||
private settings: Object = {}
|
||||
private _permissions: string[]
|
||||
|
||||
public displayName: string
|
||||
|
||||
@@ -74,6 +75,7 @@ export class SettingsService {
|
||||
if (this.settings['language']?.length)
|
||||
this.setLanguage(this.settings['language'])
|
||||
this.displayName = uisettings.display_name.trim()
|
||||
this._permissions = uisettings.permissions
|
||||
})
|
||||
)
|
||||
}
|
||||
@@ -455,4 +457,8 @@ export class SettingsService {
|
||||
this.savedViewService.dashboardViews.length == 0
|
||||
)
|
||||
}
|
||||
|
||||
public permissions(): Observable<string[]> {
|
||||
return of(this._permissions)
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user