Skip to content

Commit d3f187b

Browse files
authored
Merge pull request #1133 from jonnott/allow-override-by-type
enable allow_private_folder & allow_shared_folder to be overridden for each ‘type’
2 parents 47b6e97 + f103378 commit d3f187b

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

src/Lfm.php

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -195,6 +195,12 @@ public function getPaginationPerPage()
195195
*/
196196
public function allowMultiUser()
197197
{
198+
$type_key = $this->currentLfmType();
199+
200+
if ($this->config->has('lfm.folder_categories.' . $type_key . '.allow_private_folder')) {
201+
return $this->config->get('lfm.folder_categories.' . $type_key . '.allow_private_folder') === true;
202+
}
203+
198204
return $this->config->get('lfm.allow_private_folder') === true;
199205
}
200206

@@ -210,6 +216,12 @@ public function allowShareFolder()
210216
return true;
211217
}
212218

219+
$type_key = $this->currentLfmType();
220+
221+
if ($this->config->has('lfm.folder_categories.' . $type_key . '.allow_shared_folder')) {
222+
return $this->config->get('lfm.folder_categories.' . $type_key . '.allow_shared_folder') === true;
223+
}
224+
213225
return $this->config->get('lfm.allow_shared_folder') === true;
214226
}
215227

0 commit comments

Comments
 (0)