nextcloud / nextcloud/server

``IBootstrap::register`` called for apps that are only enabled for a group of users

Open
#30,319 6 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

1. to develop 26-feedback bug feature: apps management high
Dominant language
PHP
Stars
36.9k
Forks
5.2k
Avg merge
2d 3h
Merged PRs (30d)
713

Description

How to use GitHub
  • Please use the 👍 reaction to show that you are affected by the same issue.
  • Please don't comment if you have no relevant information to add. It's just extra noise for everyone subscribed to this issue.
  • Subscribe to receive notifications on status change and new comments.
Steps to reproduce
  1. Install and enable the Calendar app, but only for some users
  2. Open the dashboard as one of the excluded users
Expected behavior

There is no Calendar dashboard

Actual behavior

The Calendar dashboard is there and errors.

Server configuration

Nextcloud version: 22.2


Analysis

Dashboard widgets are just one example. Anything an app registers in that method is there even when it shouldn't.

As far as I could debug this happens because in \OC\AppFramework\Bootstrap\Coordinator::runInitialRegistration OC_App::getEnabledApps() return all apps, regardless of their user groups. That is because of at the time of calling the user context has not been set up yet. Only shortly later we start to load the database user back-end and similar. Afterwards OC_App::getEnabledApps() gives correct results, but not before.

Nevertheless I have not found a way to flip the order of this initialization, it just introduced even more severe problems.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Reproduce the issue with the Calendar app enabled for only some users, then inspect OC\AppFramework\Bootstrap\Coordinator::runInitialRegistration and OC_App::getEnabledApps(). Trace how app registration occurs before the user context is initialized; done means excluded users no longer see or encounter Calendar dashboard widgets or other registrations.

Written by the indexing model from the issue text.

Assessment

Tech stack
php
Domain
backend
Issue type
Bug
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.