Skip to content

[Security] enhance Voters system #2220

Open

Description

@Elorfin
  • 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).

Activity

  1. changed the title [-][Security] enhances Voters system[/-] [+][Security] enhance Voters system[/+] on Oct 20, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions