Did I find the right examples for you? yes no      Crawl my project      Python Jobs

All Samples(4)  |  Call(4)  |  Derive(0)  |  Import(0)

src/p/y/PyRfK-HEAD/lib/rfk/site/admin/__init__.py   PyRfK(Download)
def create_menu(endpoint):
    if not current_user.has_permission(code='admin'):
        return False
    menu = {'name': 'Admin', 'submenu': [], 'active': False}
    entries = []
    if current_user.has_permission(code='manage-liquidsoap'):

src/p/y/PyRfK-HEAD/lib/rfk/site/__init__.py   PyRfK(Download)
    if not current_user.is_anonymous():
        is_streaming = UserShow.query.join(User).filter(UserShow.status == UserShow.STATUS.STREAMING, UserShow.user == current_user).first()
        if is_streaming or current_user.has_permission('admin'):
            show_listener_list = True
        else:

src/p/y/PyRfK-HEAD/lib/rfk/site/helper.py   PyRfK(Download)
            else:
                return 'not logged in'
        if permission is not None and not current_user.has_permission(permission):
            if ajax:
                return emit_error(0, 'insufficient permissions')