Skip to content

Permission / Override configuration #100

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

Closed
Solirio opened this issue Jan 21, 2015 · 3 comments
Closed

Permission / Override configuration #100

Solirio opened this issue Jan 21, 2015 · 3 comments

Comments

@Solirio
Copy link

Solirio commented Jan 21, 2015

Hi. Before anything Sorry for my english if it is bad, i'm a young french developper^^

Well, i'm using your bundle since yersterday wich is really great with lots of features.
I'm using Symfony2
I was looking for two things wich i didn't find anything good enought to help me:
Permissions on folder. I explain.

I have a root path where i need to set different permission per user.
I mean i have user 'photograph' who can upload what he want in this root path or crop or resize or everything.
A second user named "bryan" who is a standard user. This one need to be only able to get file from this root path, anything else.

i mean it's just like disable button for some type of permission/user.

I don't find anything about different permission, but i know it will need different configuration for same path, wich is my second problem cuz i need dynamyc path too.

I saw on other issue is there a way with overriding configuration with a service. But i really don't understand that thing. I'm on my first project with symfony 2 and for this i was looking for an example of what i need to do. Or a better explenation. Cuz all the doc i found are too light for me.

Sorry i know this is not really an issue, but i really didn't know where to ask.

@helios-ag
Copy link
Owner

As u can see https://github.com/helios-ag/FMElfinderBundle/blob/master/Configuration/ElFinderConfigurationReader.php is a service that can be overridden by your own class in configuration, just declare your own service as described here https://github.com/helios-ag/FMElfinderBundle#custom-configuration-provider.

Here's my view on your custom configuration class:

  1. Use ElFinderConfigurationReader.php as template for your own configuration class.
  2. Inject security context in your service
  3. Check user permissions by getting user role
  4. Use disabled https://github.com/helios-ag/FMElfinderBundle/blob/master/Configuration/ElFinderConfigurationReader.php#L71 node to control user permission for creating folders/files in a specified "root"

@Solirio
Copy link
Author

Solirio commented Jan 22, 2015

Ok thank you, i need to work on overridding and security context so. I will try to do that. If i find a simple solution i will share it. Keep in touch.

@helios-ag
Copy link
Owner

Closed due to inactivity

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

2 participants