def add(ctx, catalog_name, access_list): try: client = ctx.obj['client'] in_use_org_href = ctx.obj['profiles'].get('org_href') org = Org(client, in_use_org_href) org.add_catalog_access_settings( catalog_name=catalog_name, access_settings_list=acl_str_to_list_of_dict(access_list)) stdout('Access settings added to catalog \'%s\'.' % catalog_name, ctx) except Exception as e: stderr(e, ctx)
def add(ctx, catalog_name, access_list): try: restore_session(ctx) client = ctx.obj['client'] in_use_org_href = ctx.obj['profiles'].get('org_href') org = Org(client, in_use_org_href) org.add_catalog_access_settings( catalog_name=catalog_name, access_settings_list=acl_str_to_list_of_dict(access_list)) stdout('Access settings added to catalog \'%s\'.' % catalog_name, ctx) except Exception as e: stderr(e, ctx)
def test_04_add_catalog_access(self): org_in_use = self.client.get_org_by_name( self.config['vcd']['org_in_use']) org = Org(self.client, resource=org_in_use) control_access = org.add_catalog_access_settings( self.config['vcd']['catalog'], access_settings_list=[ {'name': self.config['vcd']['access_user1'], 'type': 'user', 'access_level': 'ReadOnly'}, {'name': self.config['vcd']['access_user'], 'type': 'user', 'access_level':'Change'}, {'name': self.config['vcd']['access_org'], 'type': 'org', 'access_level': 'ReadOnly'} ]) assert len(control_access.AccessSettings.AccessSetting) == 3
def add(ctx, catalog_name, access_list): try: client = ctx.obj['client'] in_use_org_href = ctx.obj['profiles'].get('org_href') org = Org(client, in_use_org_href) updated_acl = org.add_catalog_access_settings( catalog_name=catalog_name, access_settings_list=acl_str_to_list_of_dict(access_list)) stdout( access_settings_to_list( updated_acl, ctx.obj['profiles'].get('org_in_use')), ctx, sort_headers=False) except Exception as e: stderr(e, ctx)