Neues crm-Paket mit Datenmodell, Geschäftslogik und REST-Endpunkten
für die Entität Kunde (/xhr/kunde/{list,get,create,update,delete}).
authorisation_required-Decorator: app-spezifische Rollenprüfung via
has_permission(appid, ...). SysAdmin systemweit, AppAdmin implizit in
seiner Anwendung, User (Mitarbeiter) als Basis-Rolle, Zusatz-Rollen
wie KundenManager additiv.
Flask CLI: init-db (Schema + Musterdaten + App-Rollen) und reset-db
(Bestätigung, behält SysAdmin).
config.ini: Neuer appid-Eintrag (KBPlusCRM), getrennt vom technischen
PROJEKTNAME. checkdb: appid aus config, Migration _db_V01_02 für
bestehende DBs.
Generated by Mistral Vibe.
Co-Authored-By: Mistral Vibe <vibe@mistral.ai>
31 lines
781 B
Python
31 lines
781 B
Python
from pathlib import Path
|
|
from configparser import ConfigParser
|
|
|
|
class Configuration:
|
|
def __init__(self, configfilename:str|Path):
|
|
self.config:ConfigParser = ConfigParser()
|
|
self.config.read(configfilename)
|
|
|
|
@property
|
|
def debug(self) -> bool:
|
|
return self.config["DEBUG"].getboolean("debug")
|
|
|
|
@property
|
|
def clientapp_version(self) -> str:
|
|
return self.config["APP"].get("version")
|
|
|
|
@property
|
|
def app_projectname(self) -> str:
|
|
return self.config["APP"].get("projectname")
|
|
|
|
@property
|
|
def app_appid(self) -> str:
|
|
return self.config["APP"].get("appid")
|
|
|
|
@property
|
|
def flask_secret(self) -> str:
|
|
return self.config["APP"].get("flasksecret")
|
|
|
|
|
|
|