def role_required(role_name):

    def decorator_role_required(func):

        @functools.wraps(func)
        def wrapper_role_required(*args, **kwargs):
            if (not role_name):
                return
            if current_app.config.get('USE_ACL'):
                if (role_name not in session.get('acl', {}).get('parentRoles', [])):
                    return abort(403, 'Role {0} is required'.format(role_name))
            return func(*args, **kwargs)
        return wrapper_role_required
    return decorator_role_required
def role_required(role_name):

    def decorator_role_required(func):

        @functools.wraps(func)
        def wrapper_role_required(*args, **kwargs):
            if (not role_name):
                return
            if current_app.config.get('USE_ACL'):
                if (role_name not in session.get('acl', {}).get('parentRoles', [])):
                    return abort(403, 'Role {0} is required'.format(role_name))
            return func(*args, **kwargs)
        return wrapper_role_required
    return decorator_role_required