Skip to content
This repository has been archived by the owner on Jan 15, 2025. It is now read-only.

Move permission test to the HostActions Hook #173

Merged
merged 1 commit into from
Jul 29, 2018

Conversation

lippserd
Copy link
Contributor

The Auth singleton is not fully initialized when loading modules because
modules may provide custom user backends which in turn requires the
modules to be loaded.

Checking for permissions in run.php may fail if the user is
authenticated via Web 2's external backend or any custom user backend.

Plus, run.php files should be thin with less logic as possible because
they're evaluated on every single request.

Of course Web 2 should provide something to only register hooks if
specific permissions apply like it's the case for menu entries but
this change has not been introduced yet.

Rationale: Icinga/icingaweb2#3470 and Icinga/icingaweb2#3500

refs Icinga/icingaweb2#3470

The Auth singleton is not fully initialized when loading modules because
modules may provide custom user backends which in turn requires the
modules to be loaded.

Checking for permissions in run.php fails may fail the user is
authenticated via Web 2's external backend or any custom user backend.

Plus, run.php files should be thin with less logic as possible because
they're evaluated on every single request.

Of course Web 2 should provide something to only register hooks if
specific permissions apply like it's the case for menu entries but
this change has not been introduced yet.
@Mikesch-mp
Copy link
Owner

Mikesch-mp commented Jul 26, 2018

I still learn every day :) How about a seperate conference for developers or a training?

@Mikesch-mp Mikesch-mp self-assigned this Jul 26, 2018
@Mikesch-mp Mikesch-mp added this to the 1.2.6 milestone Jul 26, 2018
@Mikesch-mp Mikesch-mp merged commit 8ca698c into Mikesch-mp:master Jul 29, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants