Skip to content

Commit c24e36d

Browse files
committed
Allow to hide People nav entry for admin
Signed-off-by: Louis Chemineau <[email protected]> Signed-off-by: nextcloud-command <[email protected]>
1 parent 229fac4 commit c24e36d

File tree

4 files changed

+7
-4
lines changed

4 files changed

+7
-4
lines changed

Diff for: js/photos-main.js

+2-2
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Diff for: js/photos-main.js.map

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Diff for: lib/Controller/PageController.php

+3
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@
4848
use OCP\Files\Search\ISearchComparison;
4949
use OCP\ICache;
5050
use OCP\ICacheFactory;
51+
use OCP\IConfig;
5152
use OCP\IL10N;
5253
use OCP\IRequest;
5354
use OCP\IUserSession;
@@ -76,6 +77,7 @@ public function __construct(
7677
IRootFolder $rootFolder,
7778
ICacheFactory $cacheFactory,
7879
LoggerInterface $logger,
80+
private IConfig $config,
7981
IL10N $l10n
8082
) {
8183
parent::__construct(Application::APP_ID, $request);
@@ -110,6 +112,7 @@ public function index(): TemplateResponse {
110112
$this->initialState->provideInitialState('maps', $this->appManager->isEnabledForUser('maps') === true);
111113
$this->initialState->provideInitialState('recognize', $this->appManager->isEnabledForUser('recognize') === true);
112114
$this->initialState->provideInitialState('systemtags', $this->appManager->isEnabledForUser('systemtags') === true);
115+
$this->initialState->provideInitialState('showPeopleMenuEntry', $this->config->getAppValue('photos', 'showPeopleMenuEntry', 'true') === 'true');
113116

114117
// Provide user config
115118
foreach (array_keys(UserConfigService::DEFAULT_CONFIGS) as $key) {

Diff for: src/Photos.vue

+1-1
Original file line numberDiff line numberDiff line change
@@ -196,7 +196,7 @@ export default {
196196
: getCurrentUser().isAdmin || isMapsInstalled,
197197
showPeopleMenuEntry: getCurrentUser() === null
198198
? false
199-
: getCurrentUser().isAdmin || isRecognizeInstalled,
199+
: (getCurrentUser().isAdmin && loadState('photos', 'showPeopleMenuEntry', true)) || isRecognizeInstalled,
200200

201201
openedSettings: false,
202202
}

0 commit comments

Comments
 (0)