Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Increase default firewall strategy for plugin legacy scripts #18138

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

cedric-anne
Copy link
Member

Checklist before requesting a review

  • I have read the CONTRIBUTING document.
  • I have performed a self-review of my code.
  • I have added tests that prove my fix is effective or that my feature works.
  • This change requires a documentation update.

Description

With the proposed changes, the default strategy applied to plugins routes/scripts will be similar than the default strategy applied to the core GLPI routes/scripts:

  • for legacy scripts, the firewall will require a valid session,
  • for Symfony routes, the firewall will require the user to has access to the central interface.

For the few plugins that would want to specify a specific strategy, it will be possible to do this:

  • either by using the method to define a strategy for legacy scripts \Glpi\Http\Firewall::addPluginStrategyForLegacyScripts() (e.g. Firewall::addPluginStrategyForLegacyScripts('myplugin', '#^/front/helpdesk_.*#', Firewall::STRATEGY_HELPDESK_ACCESS););
  • either by using the \Glpi\Security\Attribute\SecurityStrategy attribute on the correspondiing symfony route.

This change corresponds to a TODO introduced in #15614.

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

Successfully merging this pull request may close these issues.

4 participants