-
Notifications
You must be signed in to change notification settings - Fork 920
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
How to extend elfinder #581
Comments
That sounds more like a Laravel problem. I'd break that:
into
...and see what you get. |
Hi @shinokada , I think an alternative solution would be to use ElFinder's default functionality.
/*
|--------------------------------------------------------------------------
| Access filter
|--------------------------------------------------------------------------
|
| Filter callback to check the files
|
*/
'access' => 'Barryvdh\Elfinder\Elfinder::checkAccess', This will allow you to deny access to all files or particular files.
/*
|--------------------------------------------------------------------------
| Routes group config
|--------------------------------------------------------------------------
|
| The default group settings for the elFinder routes.
|
*/
'route' => [
'prefix' => config('backpack.base.route_prefix').'/elfinder',
'middleware' => ['web', 'admin'], //Set to null to disable middleware filter
], This allows you to place an extra middleware and deny access to the page altogether, if that's what you need. So if you use Backpack\PermissionManager and have a PermissionMiddleware, you can just add the middleware Hope it helps. Cheers! |
@tabacitu, Thanks for your reply. I am not sure if I am doing right. I added app/Http/MIddleware/PermissionMiddleware.php and app/Http/Middleware/RoleMiddleware.php.
I added the following in config/elfinder.php
When I visit admin/elfinder, I get an error.
I'm also not sure where I can use |
Hi @shinokada , If you defined the PermissIonMiddleware as "permission" in your Kernel.php you can use this middleware: Does this work for you? 'route' => [
'prefix' => config('backpack.base.route_prefix').'/elfinder',
- 'middleware' => ['web', 'admin','permission'], //Set to null to disable middleware filter
+ 'middleware' => ['web', 'admin','permission:file-manager'], //Set to null to disable middleware filter
],
|
I get 403 error when I visit admin/elfinder even as an admin. (Am I supposed to register it in the Kenel.php?) |
Hmm... Try to dump the permissions your user has in the PermissionMiddleware, maybe on this line, I'm positive it should work. |
Ok, it works. My permission name was 'File-manager', so I changed it to,
Thanks for your help. |
Glad to help. Cheers! |
Hi,
I'd like to limit an access to admin/elfinder. I am using PermissionManager as well. I created a permission called
File-manager
.I tried the following but not working.
and web.php
What is the best way?
The text was updated successfully, but these errors were encountered: