def build_addon_root(node_settings, name, permissions=None,
                     urls=None, extra=None, buttons=None, user=None,
                     **kwargs):
    """Builds the root or "dummy" folder for an addon.

    :param addonNodeSettingsBase node_settings: Addon settings
    :param String name: Additional information for the folder title
        eg. Repo name for Github or bucket name for S3
    :param dict or Auth permissions: Dictionary of permissions for the addon's content or Auth for use in node.can_X methods
    :param dict urls: Hgrid related urls
    :param String extra: Html to be appened to the addon folder name
        eg. Branch switcher for github
    :param list of dicts buttons: List of buttons to appear in HGrid row. Each
        dict must have 'text', a string that will appear on the button, and
        'action', the name of a function in
    :param dict kwargs: Any additional information to add to the root folder
    :return dict: Hgrid formatted dictionary for the addon root folder

    """
    permissions = permissions or DEFAULT_PERMISSIONS
    if name:
        name = u'{0}: {1}'.format(node_settings.config.full_name, name)
    else:
        name = node_settings.config.full_name
    if hasattr(node_settings.config, 'urls') and node_settings.config.urls:
        urls = node_settings.config.urls
    if urls is None:
        urls = default_urls(node_settings.owner.api_url, node_settings.config.short_name)

    forbid_edit = DISK_SAVING_MODE if node_settings.config.short_name == 'osfstorage' else False
    if isinstance(permissions, Auth):
        auth = permissions
        permissions = {
            'view': node_settings.owner.can_view(auth),
            'edit': (node_settings.owner.can_edit(auth)
                     and not node_settings.owner.is_registration
                     and not forbid_edit),
        }

    max_size = node_settings.config.max_file_size
    if user and 'high_upload_limit' in user.system_tags:
        max_size = node_settings.config.high_max_file_size

    ret = {
        'provider': node_settings.config.short_name,
        'addonFullname': node_settings.config.full_name,
        'name': name,
        'iconUrl': node_settings.config.icon_url,
        KIND: FOLDER,
        'extra': extra,
        'buttons': buttons,
        'isAddonRoot': True,
        'permissions': permissions,
        'accept': {
            'maxSize': max_size,
            'acceptedFiles': node_settings.config.accept_extensions,
        },
        'urls': urls,
        'isPointer': False,
        'nodeId': node_settings.owner._id,
        'nodeUrl': node_settings.owner.url,
        'nodeApiUrl': node_settings.owner.api_url,
    }
    ret.update(kwargs)
    return ret
dataset/ETHPy150Open CenterForOpenScience/osf.io/website/util/rubeus.py/build_addon_root/original