server icon indicating copy to clipboard operation
server copied to clipboard

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

Open ChristophWurst opened this issue 4 years ago • 5 comments

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.

ChristophWurst avatar Dec 17 '21 14:12 ChristophWurst

Hi, please update to at least 23.0.12 and report back if it fixes the issue. Thank you!

szaimen avatar Nov 26 '22 14:11 szaimen

It doesn't.

ChristophWurst avatar Nov 26 '22 14:11 ChristophWurst

which nc version did you test?

szaimen avatar Nov 26 '22 14:11 szaimen

This issue has been automatically marked as stale because it has not had recent activity and seems to be missing some essential information. It will be closed if no further activity occurs. Thank you for your contributions.

nextcloud-command avatar Dec 28 '22 00:12 nextcloud-command

\OC\AppFramework\Bootstrap\Coordinator::runInitialRegistration still behaves the same way on latest master

ChristophWurst avatar Dec 28 '22 08:12 ChristophWurst