Esempio n. 1
0
def add_section(section, issuer=None):
    """
    Add a section to the configuration.

    :param section: The name of the section.
    :param issuer: The issuer account.
    """

    kwargs = {'issuer': issuer, 'section': section}
    if not permission.has_permission(issuer=issuer, action='config_add_section', kwargs=kwargs):
        raise exception.AccessDenied('%s cannot add section %s' % (issuer, section))
    return config.add_section(section)
Esempio n. 2
0
def add_section(section, issuer=None):
    """
    Add a section to the configuration.

    :param section: The name of the section.
    :param issuer: The issuer account.
    """

    kwargs = {'issuer': issuer, 'section': section}
    if not permission.has_permission(issuer=issuer, action='config_add_section', kwargs=kwargs):
        raise exception.AccessDenied('%s cannot add section %s' % (issuer, section))
    return config.add_section(section)
Esempio n. 3
0
def add_section(section, issuer=None, vo='def', session=None):
    """
    Add a section to the configuration.

    :param section: The name of the section.
    :param issuer: The issuer account.
    :param session: The database session in use.
    :param vo: The VO to act on.
    """

    kwargs = {'issuer': issuer, 'section': section}
    if not permission.has_permission(issuer=issuer,
                                     vo=vo,
                                     action='config_add_section',
                                     kwargs=kwargs,
                                     session=session):
        raise exception.AccessDenied('%s cannot add section %s' %
                                     (issuer, section))
    return config.add_section(section, session=session)