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

[Security] enhance Voters system #2220

Open
1 of 9 tasks
Elorfin opened this issue Sep 24, 2022 · 0 comments
Open
1 of 9 tasks

[Security] enhance Voters system #2220

Elorfin opened this issue Sep 24, 2022 · 0 comments

Comments

@Elorfin
Copy link
Member

Elorfin commented Sep 24, 2022

  • Extend Symfony\Component\Security\Core\Authorization\Voter\Voter.

This will automatically enable the new CacheableVoter feature after the symony upgrade.

  • Clean interface provided by Claroline\CoreBundle\Security\Voter\AbstractVoter.

    • Remove container injection.
    • Do not override symfony behavior. There is a lot of custom logic which is not really needed at all.
    • Move helpers (isToolGranted, isAdmin, etc.) into traits and only use it where needed.
  • Create an OrganizationManagerVoter to grant all accesses.

  • Create a WorkspaceManagerVoter to grant all accesses.

  • Declare Claroline\CoreBundle\Security\Voter\AbstractVoter as abstract service

For now we use the _instanceof feature in yml config. But it must be copied into each voter file which is tedious/hard to maintain.

  • Remove VIEW attribute (it's never used).
@Elorfin Elorfin changed the title [Security] enhances Voters system [Security] enhance Voters system Oct 20, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant