Description of Problem:
Hello everybody! Here is what I need:
I need to create a custom MediaSource for non-administrative backend content editors. The idea is simple and clear -- give to content editors access only to one folder for image storage purposes, e.g.
OK, I've created a user, user group, resource group, and custom policy based on 'Content-Editor' policy with
file_* and
directory_* permissions. Also there was checked
source_view permission, I'm not sure was it by default or not.
Then I've created MediaSource with following configuration:
BasePath = assets/common/
BasePathRelative = Yes
BaseURL = (blank)
BaseURLRelative = Yes
Then I've mixed it all together, set user as MediaSource Admin and faced the first problem: to get access to files in my MediaSource I need to set BaseURL to 'manager/', because other way I can't even fetch filelist in my MediaSource.
OK. 'No problems!' I've thought. But I was wrong.
Second problem is that my editor can switch between media sources and choose
Filesystem even if there is only one media source allowed (my custom media source) and gain full access to files. I've tried to uncheck 'source_view' in my editor's policy. This is not solved my problem, because in this case editor can't choose mediasource and Filesystem is set by default. Tested several times, every time the same behavior. At this point I left 'source_view' checked.
Then I faced the last problem which led me to the Forums after few hours of combining different setting together.
First I've noticed that when I try to insert image into resource final image url is incorrect.
Example:
BasePath = assets/common/
BasePathRelative = Yes
BaseURL = manager/
BaseURLRelative = Yes
Final URL is
manager/assets/common/ instead of
assets/common/
Then I've tried to change BasePath to full path and switch BasePathRelative = No, create folder in 'manager' folder and share it, change base URL to <sitename>/manger and switch BaseURL to No, and mixing that parameters all together, each time logging out and in my editor.
After a few hours of attempts I'm totally confused. How can I make this work? It there a clear guide to configure custom media source?
Please help somebody!
P.S. Forgive me if my explanations are unclean and forgive me my mistakes. I'm from Russia and sometimes it's realy hard to explain exactly what I mean in English.
- MODX Version: 2.2.5-pl traditional
- PHP Version: 5.3.13
[ed. note: Geraldus last edited this post 13 years, 10 months ago.]