def get_permissions(user, featuretype_name):
    """
    Gets the permissions for the provided user and feature type.
    Returns a tuple (can_write, can_publish)
    """
    if user.is_superuser:
        result = (True, True)
    else:
        is_writer = getattr(
            user, "is_{}_writer".format(featuretype_name), False)
        is_publisher = getattr(
            user, "is_{}_publisher".format(featuretype_name), False)
        result = (is_writer, is_publisher)
    return result