Closed zorn-v closed 1 month ago
Seconded.
It's easy to block menu items but a pain to set permissions for a whole CRUD, especially with the actions piling up.
Even better would be to have a voter for a whole CRUD.
Even better would be to have a voter for a whole CRUD.
You can use setEntityPermission
in configureCrud
Indeed, though it only accepts an Expression which is, IMO, not on par with a voter.
it only accepts an Expression
No, it also accept string, and you can pass role there
Indeed, I misread the related documentation.
Best documentation is source code :wink: https://github.com/EasyCorp/EasyAdminBundle/blob/8f17e48533b1c5979328fe71b9a02275d45baa84/src/Config/Crud.php#L392
Currently there is no proper way to determine on which entity index/new action performed. It is useful for some sort of ACL like "user can create/view listing of some entity but not of other entities" stored in DB for example.
Actually you can get
crudControllerFqcn
query parameter and callgetEntityFqcn
static method on it now, but it is not good way I think.