barryvdh / laravel-elfinder

elFinder bundle for Laravel
745 stars 171 forks source link

Permissions #189

Open sairam2188 opened 7 years ago

sairam2188 commented 7 years ago

Hi,

I need to configure a read only for all disk. I have the following: `<?php

return array(

/*
|--------------------------------------------------------------------------
| Upload dir
|--------------------------------------------------------------------------
|
| The dir where to store the images (relative from public)
|
*/
'dir' => ['files'],

/*
|--------------------------------------------------------------------------
| Filesystem disks (Flysytem)
|--------------------------------------------------------------------------
|
| Define an array of Filesystem disks, which use Flysystem.
| You can set extra options, example:
|
| 'my-disk' => [
|        'URL' => url('to/disk'),
|        'alias' => 'Local storage',
|    ]
*/
'disks' => [
    'local'
],

/*
|--------------------------------------------------------------------------
| Routes group config
|--------------------------------------------------------------------------
|
| The default group settings for the elFinder routes.
|
*/

'route' => [
    'prefix' => 'elfinder',
    'middleware' => null, //Set to null to disable middleware filter
],

/*
|--------------------------------------------------------------------------
| Access filter
|--------------------------------------------------------------------------
|
| Filter callback to check the files
|
*/

'access' => 'Barryvdh\Elfinder\Elfinder::checkAccess',

/*
|--------------------------------------------------------------------------
| Roots
|--------------------------------------------------------------------------
|
| By default, the roots file is LocalFileSystem, with the above public dir.
| If you want custom options, you can set your own roots below.
|
*/

'roots' => null,

/*
|--------------------------------------------------------------------------
| Options
|--------------------------------------------------------------------------
|
| These options are merged, together with 'roots' and passed to the Connector.
| See https://github.com/Studio-42/elFinder/wiki/Connector-configuration-options-2.1
|
*/

'options' => array(),

/*
|--------------------------------------------------------------------------
| Root Options
|--------------------------------------------------------------------------
|
| These options are merged, together with every root by default.
| See https://github.com/Studio-42/elFinder/wiki/Connector-configuration-options-2.1#root-options
|
*/
'root_options' => array(
    'defaults'   => array('read' => true, 'write' => false),
),

); ` Thanks.

brimestoned commented 2 years ago

This seemed to work for me.

'disks' => array( env('FILESYSTEM_CLOUD', 's3') => [ 'alias' => 'Primary', 'path' => '/elFinder', 'uploadOverwrite' => false, 'acceptedName' => '/^\w[\w\s.-]*$/', 'attributes' => array( array( 'pattern' => '/./', 'read' => true, 'write' => false, 'locked' => true )
) ] )