Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Expose the app version to the capabilities endpoint #2861

Merged
merged 2 commits into from
Aug 28, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion lib/AppInfo/Capabilities.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,17 +8,20 @@
namespace OCA\GroupFolders\AppInfo;

use OCA\GroupFolders\Folder\FolderManager;
use OCP\App\IAppManager;
use OCP\Capabilities\ICapability;
use OCP\IUser;
use OCP\IUserSession;

class Capabilities implements ICapability {
private IUserSession $userSession;
private FolderManager $folderManager;
private IAppManager $appManager;

public function __construct(IUserSession $userSession, FolderManager $folderManager) {
public function __construct(IUserSession $userSession, FolderManager $folderManager, IAppManager $appManager) {
$this->userSession = $userSession;
$this->folderManager = $folderManager;
$this->appManager = $appManager;
}

public function getCapabilities(): array {
Expand All @@ -28,6 +31,7 @@ public function getCapabilities(): array {
}
return [
Application::APP_ID => [
'appVersion' => $this->appManager->getAppVersion(Application::APP_ID),
'hasGroupFolders' => $this->hasFolders($user),
],
];
Expand Down
Loading