File tree Expand file tree Collapse file tree 1 file changed +9
-1
lines changed
apps/files_external/lib/Lib/Storage Expand file tree Collapse file tree 1 file changed +9
-1
lines changed Original file line number Diff line number Diff line change @@ -97,6 +97,9 @@ class SMB extends Common implements INotifyStorage {
9797 /** @var bool */
9898 protected $ checkAcl ;
9999
100+ /** @var bool */
101+ protected $ rootWritable ;
102+
100103 public function __construct ($ params ) {
101104 if (!isset ($ params ['host ' ])) {
102105 throw new \Exception ('Invalid configuration, no host provided ' );
@@ -134,6 +137,7 @@ public function __construct($params) {
134137
135138 $ this ->showHidden = isset ($ params ['show_hidden ' ]) && $ params ['show_hidden ' ];
136139 $ this ->checkAcl = isset ($ params ['check_acl ' ]) && $ params ['check_acl ' ];
140+ $ this ->rootWritable = isset ($ params ['root_force_writable ' ]) && $ params ['root_force_writable ' ];
137141
138142 $ this ->statCache = new CappedMemoryCache ();
139143 parent ::__construct ($ params );
@@ -573,7 +577,11 @@ public function getMetaData($path) {
573577 private function getMetaDataFromFileInfo (IFileInfo $ fileInfo ) {
574578 $ permissions = Constants::PERMISSION_READ + Constants::PERMISSION_SHARE ;
575579
576- if (!$ fileInfo ->isReadOnly ()) {
580+ if (
581+ !$ fileInfo ->isReadOnly () || (
582+ $ this ->rootWritable && $ fileInfo ->getPath () == $ this ->buildPath ('' )
583+ )
584+ ) {
577585 $ permissions += Constants::PERMISSION_DELETE ;
578586 $ permissions += Constants::PERMISSION_UPDATE ;
579587 if ($ fileInfo ->isDirectory ()) {
You can’t perform that action at this time.
0 commit comments