Skip to content

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

Open

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    • Status

      🧭 Planning evaluation

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions