Skip to content

[Security] enhance Voters system #2220

@Elorfin

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).

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