setName('organization-folders:list-organization-roles')
->setDescription('List all roles in a specific organization')
->addArgument('provider-id', InputArgument::REQUIRED, 'provider to query')
->addArgument('organization-id', InputArgument::REQUIRED, 'organization id to query roles of');
parent::configure();
}
protected function execute(InputInterface $input, OutputInterface $output): int {
try {
$providerId = $input->getArgument('provider-id');
$organizationId = (int)$input->getArgument('organization-id');
if(!$this->organizationProviderManager->hasOrganizationProvider($providerId)) {
$output->writeln("organization provider not found");
return 0;
}
$roles = $this->organizationProviderManager->getOrganizationProvider($providerId)->getRolesOfOrganization($organizationId);
$this->writeTableInOutputFormat($input, $output, $this->formatTableSerializables($roles));
return 0;
} catch (Exception $e) {
$output->writeln("Exception \"{$e->getMessage()}\" at {$e->getFile()} line {$e->getLine()}");
return 1;
}
}
}