Skip to content

Commit

Permalink
Merge pull request #194 from nextcloud/feature/sorbaugh/files-downloa…
Browse files Browse the repository at this point in the history
…d-capabilities
  • Loading branch information
skjnldsv authored Oct 4, 2023
2 parents 2bccde6 + c726ba3 commit 393e8ae
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æ <skjnldsv@protonmail.com>
*
* @author John Molakvoæ <skjnldsv@protonmail.com>
* @author Stephan Orbaugh <stephan.orbaugh@nextcloud.com>
*
* @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 <stephan.orbaugh@nextcloud.com>
*
* @author Stephan Orbaugh <stephan.orbaugh@nextcloud.com>
*
* @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 [
'downloadlimit' => [
'enabled' => true
]
];
}
}

0 comments on commit 393e8ae

Please sign in to comment.