Bumps [nextcloud/coding-standard](https://github.com/nextcloud/coding-standard) from 1.2.1 to 1.2.3. - [Release notes](https://github.com/nextcloud/coding-standard/releases) - [Changelog](https://github.com/nextcloud/coding-standard/blob/master/CHANGELOG.md) - [Commits](https://github.com/nextcloud/coding-standard/compare/v1.2.1...v1.2.3) --- updated-dependencies: - dependency-name: nextcloud/coding-standard dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <support@github.com>
45 lines
1.0 KiB
PHP
45 lines
1.0 KiB
PHP
<?php
|
|
/**
|
|
* SPDX-FileCopyrightText: 2019 Nextcloud GmbH and Nextcloud contributors
|
|
* SPDX-License-Identifier: AGPL-3.0-or-later
|
|
*/
|
|
|
|
namespace OCA\Deck;
|
|
|
|
use OCA\Deck\Service\PermissionService;
|
|
use OCP\App\IAppManager;
|
|
use OCP\Capabilities\ICapability;
|
|
|
|
class Capabilities implements ICapability {
|
|
|
|
/** @var IAppManager */
|
|
private $appManager;
|
|
/** @var PermissionService */
|
|
private $permissionService;
|
|
|
|
|
|
public function __construct(IAppManager $appManager, PermissionService $permissionService) {
|
|
$this->appManager = $appManager;
|
|
$this->permissionService = $permissionService;
|
|
}
|
|
|
|
/**
|
|
* Function an app uses to return the capabilities
|
|
*
|
|
* @return array{deck: array{version: string, canCreateBoards: bool, apiVersions: array<string>}}
|
|
* @since 8.2.0
|
|
*/
|
|
public function getCapabilities() {
|
|
return [
|
|
'deck' => [
|
|
'version' => $this->appManager->getAppVersion('deck'),
|
|
'canCreateBoards' => $this->permissionService->canCreate(),
|
|
'apiVersions' => [
|
|
'1.0',
|
|
'1.1'
|
|
]
|
|
]
|
|
];
|
|
}
|
|
}
|