I need to implement a user permission system for my Symfony 4 application. All permissions and possible method calls are stored inside a separate database table, and there is also a cross-reference table which decides which of the CRUD operations can be performed by every user. So far I would go with the voter system from Symfony, however I'm not sure if I could build a global voter which simply takes an attribute (let's say "EDIT") for a given method call passed to the voter class as subject? I would like to do something like the following my controller classes:
$this->denyAccessUnlessGranted('CREATE', 'METHOD_A');
In the symfony documentation there is an advice to create one voter per entity. But due to the current architecture of my application (support of external plugins, other developers may extend it etc.) I cannot predict what entities maybe installed in future, therefore I cannot create voters for unknown entities.
So I would like to know if it is possible to use a global voter to handle these permission checks?