-
Notifications
You must be signed in to change notification settings - Fork 58
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
Why autocomplete
action is mapped to list
action?
#113
Comments
Hi @Bloodysunset, This bundle brings a role-based security layer, and every action might be "protected" by requiring a specific role. I don't think that somebody who do not have access of Foo list should be able to list them in an autocomplete field... What do you think ? |
Hello PéCé, While I 100% understand your point, my client doesn't. He will tell me that his collaborators should only be able to filter specifics listings (with autocomplete filters based on lists accessibles only by administrators). So to 'fix' my problem, I've set the My issue is now 'fixed', but I think that being able to configure the Not saying that you should make that change however, just wanted to share my experience with this issue/request from the client. |
Override in AdminController: protected function isActionAllowed($actionName)
{
switch ($actionName) {
// autocomplete action is mapped to list action for access permissions
case 'autocomplete':
break;
// embeddedList action is mapped to list action for access permissions
case 'embeddedList':
$actionName = 'list';
break;
...
} |
I share your opinion : this workaround is not a solution. I think we should define by configuration, the action name mapped onto config/easy_admin_extension.yaml
|
@gonzakpo I've tried to override it, but was unsuccessful doing so (maybe something wrong on my end). @alterphp This sounds great. I can't give you an ETA on when I'll be able to work on it, but yes! Thank you for taking the time to clarify things about this feature :) |
Keep it open, and mention it in the PR when you will be able to work on it ! I'm glad to gain a new contributor ;-) |
add break; and functioned for my |
Hi everyone. This issue is not about a bug, but to bring a discussion about the state of a functionality.
Currently, we can define a role per action in our entities to lock some users from accessing the
show
action for example. This is fine and great, but here is the issue...I was trying to get results from an
autocomplete
field on a user with an inferior role. So I configured my entity like this :I could not understand why this would not work, until I find that the
isActionAllowed()
is overrided in theEasyAdminController.php
of this bundle. Here is how it looks like :You can see that the
autocomplete
action is treated like thelist
one.And this is where I'm lost : is there a particular reason we're not able to configure the
autocomplete
action to be used by a lesser role? If not, it would be great to "fix" this by removing this action from theswitch
case.I'm open to discuss about it.
Have a great day/night.
The text was updated successfully, but these errors were encountered: