基本构建
This commit is contained in:
@@ -0,0 +1,13 @@
|
||||
from flask import session
|
||||
|
||||
|
||||
def init_template_global(app):
|
||||
@app.template_global()
|
||||
def authorize(power):
|
||||
# print(power)
|
||||
# print(session.get('permissions'))
|
||||
return bool(power in session.get('permissions'))
|
||||
|
||||
@app.template_global()
|
||||
def ab(a,b):
|
||||
return a+b
|
||||
Reference in New Issue
Block a user