0
0
Fork 0
mirror of https://github.com/verdigado/organization_folders.git synced 2024-11-24 05:30:27 +01:00
organization_folders/lib/AppInfo/Application.php

43 lines
1.4 KiB
PHP
Raw Permalink Normal View History

2024-08-20 15:03:44 +02:00
<?php
namespace OCA\OrganizationFolders\AppInfo;
use Psr\Container\ContainerInterface;
2024-08-20 15:03:44 +02:00
use OCP\AppFramework\App;
use OCP\AppFramework\Bootstrap\IBootstrap;
use OCP\AppFramework\Bootstrap\IRegistrationContext;
use OCP\AppFramework\Bootstrap\IBootContext;
use OCP\IUserSession;
2024-08-20 15:03:44 +02:00
use OCA\DAV\Events\SabrePluginAddEvent;
2024-11-16 03:25:50 +01:00
use OCA\Files\Event\LoadAdditionalScriptsEvent;
use OCA\OrganizationFolders\Listener\SabrePluginAddListener;
2024-11-16 03:25:50 +01:00
use OCA\OrganizationFolders\Listener\LoadAdditionalScripts;
use OCA\OrganizationFolders\Security\AuthorizationService;
use OCA\OrganizationFolders\Security\ResourceVoter;
use OCA\OrganizationFolders\Security\OrganizationFolderVoter;
class Application extends App implements IBootstrap {
2024-08-20 15:03:44 +02:00
public const APP_ID = 'organization_folders';
public function __construct() {
parent::__construct(self::APP_ID);
}
public function register(IRegistrationContext $context): void {
2024-11-16 03:25:50 +01:00
$context->registerEventListener(LoadAdditionalScriptsEvent::class, LoadAdditionalScripts::class);
$context->registerEventListener(SabrePluginAddEvent::class, SabrePluginAddListener::class);
$context->registerService(AuthorizationService::class, function (ContainerInterface $c) {
$service = new AuthorizationService($c->get(IUserSession::class));
$service->registerVoter($c->get(OrganizationFolderVoter::class));
$service->registerVoter($c->get(ResourceVoter::class));
return $service;
});
}
public function boot(IBootContext $context): void {
}
2024-08-20 15:03:44 +02:00
}