Skip to content

Commit

Permalink
add capabilities to app. resolves issue #173
Browse files Browse the repository at this point in the history
  • Loading branch information
sorbaugh committed Sep 15, 2023
1 parent 352785f commit ba09e48
Show file tree
Hide file tree
Showing 2 changed files with 46 additions and 0 deletions.
4 changes: 4 additions & 0 deletions lib/AppInfo/Application.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
* @copyright Copyright (c) 2021 John Molakvoæ <[email protected]>
*
* @author John Molakvoæ <[email protected]>
* @author Stephan Orbaugh <[email protected]>
*
* @license GNU AGPL version 3 or any later version
*
Expand All @@ -26,6 +27,7 @@

namespace OCA\Files_DownloadLimit\AppInfo;

use OCA\Files_DownloadLimit\Capabilities;
use OCA\Files\Event\LoadSidebar;
use OCA\Files_DownloadLimit\Listener\BeforeTemplateRenderedListener;
use OCA\Files_DownloadLimit\Listener\LoadSidebarListener;
Expand Down Expand Up @@ -53,6 +55,8 @@ public function register(IRegistrationContext $context): void {
$eventDispatcher->addServiceListener(BeforeTemplateRenderedEvent::class, BeforeTemplateRenderedListener::class);
$eventDispatcher->addServiceListener(LoadSidebar::class, LoadSidebarListener::class);
$eventDispatcher->addServiceListener(ShareLinkAccessedEvent::class, ShareLinkAccessedListener::class);

$context->registerCapability(Capabilities::class);
}

public function boot(IBootContext $context): void {
Expand Down
42 changes: 42 additions & 0 deletions lib/Capabilities.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
<?php

declare(strict_types=1);

/**
* @copyright Copyright (c) 2023 Stephan Orbaugh <[email protected]>
*
* @author Stephan Orbaugh <[email protected]>
*
* @license GNU AGPL version 3 or any later version
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as
* published by the Free Software Foundation, either version 3 of the
* License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/
namespace OCA\Files_DownloadLimit;

use OCP\Capabilities\ICapability;

class Capabilities implements ICapability {

/**
* @return array{files: array{downloadlimit: bool}}
*/
public function getCapabilities(): array {
return [
'files' => [
'downloadlimit' => true,
]
];
}
}

0 comments on commit ba09e48

Please sign in to comment.