You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
31 lines
919 B
Python
31 lines
919 B
Python
from __future__ import annotations
|
|
|
|
from iti.modules import ModulePermission
|
|
|
|
from .routes import router
|
|
|
|
|
|
class ExchangeModule:
|
|
name = "exchange"
|
|
|
|
def register_routes(self, app) -> None:
|
|
app.include_router(router)
|
|
|
|
def register_permissions(self, app) -> None:
|
|
app.state.iti_modules.register_permission(
|
|
ModulePermission("exchange:template:list", "数据模板列表")
|
|
)
|
|
app.state.iti_modules.register_permission(
|
|
ModulePermission("exchange:template:manage", "数据模板管理")
|
|
)
|
|
app.state.iti_modules.register_permission(
|
|
ModulePermission("exchange:task:create", "导入导出任务创建")
|
|
)
|
|
app.state.iti_modules.register_permission(
|
|
ModulePermission("exchange:task:list", "导入导出任务列表")
|
|
)
|
|
|
|
|
|
def create_exchange_module() -> ExchangeModule:
|
|
return ExchangeModule()
|