How to forbid to create and upload folders to file manager #671
-
Received this by email today:
|
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
Hi!
'disks' => [
'mydisk' => [
'alias' => 'Storage',
'accessControl' => 'App\Http\Middleware\ElfinderAccess::checkAccess',
'visibility' => 'public',
],
],
<?php
namespace App\Http\Middleware;
class ElfinderAccess
{
public static function checkAccess($attr, $path, $data, $volume)
{
if (...) { // your rules
return false;
}
return true;
}
} Regarding the rules you need, I'm not quite sure about it, but I think you'll need to check for the commands. if($attr === 'mkdir') {
return false;
} Since there isn't much information on the internet about it, probably the easiest is to |
Beta Was this translation helpful? Give feedback.
Hi!
In order to control what gets done or not in file manager, you must use a middleware.
config\elfinder.php
, and add theaccessControl
key to your disk.Note that you can have multiple disks with different access control.
app\Http\MiddlewareElfinderAccess.php
middelware.