Clone
12
Simple file permissions control
Naoki Sawada edited this page 2018-07-26 21:19:06 +09:00
This file contains invisible Unicode characters
This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

TODO describe more how locked and hidden works

Assign an attributes array inside the specific mounted driver you would like to set the permissions for.

Example:

<?php
array(
	'driver' => 'LocalFileSystem', // driver for accessing file system (REQUIRED)
	'path'   => 'path/to/files',   // path as root to files (REQUIRED)
	'attributes' => array(
         // The first matching of the multiple patterns will be applied. (elFinder >= 2.1.33)
		array(
			// You can also set permissions for file types by adding, for example, \.jpg inside pattern.
                        // The path for pattern evaluation is passed by converting the path as the root to '/'.
                        'pattern' => '/^\/TEST$/',
			'read'    => false,
			'write'   => false,
			'locked'  => true
		)
	)
),

You can set the following true/false to the attributes:

'read'   => true/false,
'write'  => true/false,
'locked' => true/false,
'hidden' => true/false

Discussion: https://github.com/Studio-42/elFinder/issues/98#issuecomment-1866553