Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ability to set disk at runtime #117

Open
toonevdb opened this issue Feb 11, 2020 · 2 comments
Open

Ability to set disk at runtime #117

toonevdb opened this issue Feb 11, 2020 · 2 comments

Comments

@toonevdb
Copy link

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.

@mokchend
Copy link

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.

@takifouhal
Copy link

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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants