Several user groups and separate access

Hi, I want to create a few user groups in CMS with separate accesses (to resources and files). In other words, I want each group to be able to see different resources in CMS and different files in media source after logging in.

Currently, I have two users (user1 and user2) assigned to two user groups (beneficiary 1 and beneficiary 2). Each user group has a separate Resource Groups and Media Source. After logging in, each user sees different resources and has a different file repository. For example, user1 sees in Resources Folder beneficiary 1 and in Files he sees the folder ms1.

The problem starts when the image TV is set in the resource, because Media Sources for two sources (ms1 and ms2) cannot be set in TV. And all groups will use the same templates and the same template variables. Currently, if I don’t set any Source to TV (image) in Media Source, you can’t see the field to select an image at all. And if I select Source ms1 then only user1 sees it, but user2 does not. How to do this correctly?

I’m not sure if what you’re trying to do is possible.

An image TV saves the path of the image file relative to the base-url of the media source. An image TV can only have one media-source, because otherwise the file path would be ambiguous.


Maybe you could try something that is similar to this solution for resource-specific media sources in MIGX. Here a snippet is used in the settings for basePath and baseUrl of the media-source. That makes the path of the media-source dynamic, based on the resource-ID. Something similar could be achieved by using the template-ID or maybe the ID of the parent resource.

I believe that there must be a way. If you can make a separate Resource and a separate Media Source then it must be possible to use these separate files on TV. Otherwise, why create separate Media Source if you can’t use them on TV?

I’ve never tried this, but I think you could put the TVs in different categories and use an Element Category Access ACL entry to protect them.

@halftrainedharry @bobray

So far I managed to achieve the desired goal but in a very inefficient way. Namely, for each user (group of users) I created a separate TV (photo) with separate access to Media Source and with separate Access Permissions (visibility) in the template. Now each user can see in the template they will change the TV named Photo and have access to their photos in Media Source. But this solution forces the creation of very many of the same TV to one template. If I want to have 5 TVs in one template with access to Media Source so that 20 user groups can manage it, I will have to create as many as 100 TVs! These are absurd solutions but so far the only one I’ve been able to do.

Does anyone have any more ideas?

Is the site in MODX 2.x, or 3.x?

The site is under construction and I am using the latest version of MODX 3.x

I’m afraid I don’t really understand your use case, with respect to media sources and TVs.

My only thought is that you might be able to use NewsPublisher in the front end by configuring its elFinder browser, which allows you to assign multiple browser roots. In other words, users will be able to browse in and under more than one directory.

See the “Configuring elFinder” section here.

I had an idea, but it didn’t work out. If MODX assigned IDs to the folders in the media browser file tree, this would be easy.