mirror of
https://github.com/verdigado/organization_folders.git
synced 2024-12-06 11:22:41 +01:00
first draft of ACL rule management
This commit is contained in:
parent
5a2f872b2d
commit
f652b13dd3
6 changed files with 223 additions and 17 deletions
|
@ -0,0 +1,34 @@
|
|||
<?php
|
||||
|
||||
namespace OCA\OrganizationFolders\Command\OrganizationFolder;
|
||||
|
||||
use OCP\DB\Exception;
|
||||
use Symfony\Component\Console\Input\InputArgument;
|
||||
use Symfony\Component\Console\Input\InputInterface;
|
||||
use Symfony\Component\Console\Output\OutputInterface;
|
||||
|
||||
use OCA\OrganizationFolders\Command\BaseCommand;
|
||||
|
||||
class FixACLsOfOrganizationFolder extends BaseCommand {
|
||||
protected function configure(): void {
|
||||
$this
|
||||
->setName('organization-folders:recreate-acls')
|
||||
->setDescription('Ensures all ACLs of organization folder are correctly set. Should not be neccessary to run unless ACL rules have been modified accidentally by an admin as ACLs will be created/modified automatically as resources are changed')
|
||||
->addArgument('id', InputArgument::REQUIRED, 'Id of the organization folder');
|
||||
}
|
||||
|
||||
protected function execute(InputInterface $input, OutputInterface $output): int {
|
||||
$id = (int)$input->getArgument('id');
|
||||
|
||||
try {
|
||||
$output->writeln(var_dump($this->organizationFolderService->applyPermissions($id)));
|
||||
|
||||
$output->writeln("done");
|
||||
|
||||
return 0;
|
||||
} catch (Exception $e) {
|
||||
$output->writeln("<error>Exception \"{$e->getMessage()}\" at {$e->getFile()} line {$e->getLine()}</error>");
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue