Ability to set disk at runtime
What I am trying to achieve, is to set a different disk depending on the user role like so:
if (Auth::user() && Auth::user()->hasRole('superadmin')) {
config(['filemanager.disk' => 'public']);
}
I tried placing that codeblock first in a Middleware and then in NovaServiceProdiver@tools method at the top. But the tool only picks up what I have set in config/filemanager.php.
Is it possible to have it pick up config changes at runtime? I'm a bit unsure of Nova Tools lifecycle. I don't understand why the 'config set' call is not picked up. If I log to a debug file, I notice the 'config set call' happens before constructing Nova-Filemanager/Http/Services/FilemanagerService. Maybe I'm missing something. Would be nice if there was a way to somehow set the disk at runtime but unsure if it's possible.
Yes, would be nice to lockdown the registered user in dynamic folder based on user's (unique) name or Id, so only registered user can see the files & folders owned.
Yes, would be nice to lockdown the registered user in dynamic folder based on user's (unique) name or Id, so only registered user can see the files & folders owned.
did you figure out how to do it?