def validate_permission(resources, resource_type, perm):
    if (not resources):
        return
    if current_app.config.get('USE_ACL'):
        if (g.user.username == 'worker'):
            return
        resources = ([resources] if isinstance(resources, six.string_types) else resources)
        for resource in resources:
            if (not ACLManager().has_permission(resource, resource_type, perm)):
                return abort(403, 'has no permission')
def validate_permission(resources, resource_type, perm):
    if (not resources):
        return
    if current_app.config.get('USE_ACL'):
        if (g.user.username == 'worker'):
            return
        resources = ([resources] if isinstance(resources, six.string_types) else resources)
        for resource in resources:
            if (not ACLManager().has_permission(resource, resource_type, perm)):
                return abort(403, 'has no permission')