def require(self, func):
@wraps(func)
def _decorator(*args, **kwargs):
if hasattr(g, "identity") and g.identity.can(self):
return func(*args, **kwargs)
else:
return {"status": "failure", "result": {"error": u"????????"}}, 403
return _decorator
评论列表
文章目录