(user, recipe)
return False
Returns runnable.
Returns runnable.
Returns runnable .
def authorize_run(user, recipe):
    """
    Returns runnable.
    """
    # An anonymous user cannot run recipes.
    if user.is_anonymous:
        return False

    # Only users with access can run recipes
    readable = is_readable(user=user, obj=recipe.project, strict=True)

    if not readable:
        return False

    # A trusted user can run recipes that they have access to.
    if user.profile.trusted and recipe.runnable():
        return True

    # A superuser can run all recipes.
    if user.is_superuser:
        return True

    return False
def authorize_run ( user , recipe ) : # An anonymous user cannot run recipes. if user . is_anonymous : return False # Only users with access can run recipes readable = is_readable ( user = user , obj = recipe . project , strict = True ) if not readable : return False # A trusted user can run recipes that they have access to. if user . profile . trusted and recipe . runnable ( ) : return True # A superuser can run all recipes. if user . is_superuser : return True return False