1234567891011121314151617181920212223242526272829303132333435363738394041424344 |
- """
- walle-web
- :copyright: © 2015-2017 walle-web.io
- :created time: 2017-06-11 15:40:38
- :author: wushuiyong@walle-web.io
- """
- import logging
- from functools import wraps
- from flask import current_app
- from flask_login import current_user
- class Access:
- def __init__(self):
- pass
- @staticmethod
- def is_login():
-
- current_app.logger.info(current_user.is_authenticated)
- return current_user.is_authenticated
- @staticmethod
- def is_allow(action, controller, module=None):
-
- current_resource = Access.resource(action, controller, module)
-
- return True
-
-
-
-
-
-
-
- @staticmethod
- def resource(action, controller, module=None):
- return "{}_{}_{}".format(module, controller, str(action))
|