Fixed the permission so that the template helper also use the wrapper can_view and can_edit, that can_edit always requires the user to log in first.
This commit is contained in:
parent
2d3b9f68b8
commit
c67ed4471c
@ -103,5 +103,5 @@ def init_app(app: Flask, can_view_func: t.Callable[[], bool] | None = None,
|
|||||||
__can_view_func = can_view_func
|
__can_view_func = can_view_func
|
||||||
if can_edit_func is not None:
|
if can_edit_func is not None:
|
||||||
__can_edit_func = can_edit_func
|
__can_edit_func = can_edit_func
|
||||||
app.jinja_env.globals["can_view_accounting"] = __can_view_func
|
app.jinja_env.globals["can_view_accounting"] = can_view
|
||||||
app.jinja_env.globals["can_edit_accounting"] = __can_edit_func
|
app.jinja_env.globals["can_edit_accounting"] = can_edit
|
||||||
|
Loading…
Reference in New Issue
Block a user