Is it possible to for a Drupal Role to have multiple IMCE roles? The current system works where the IMCE role has a precedence set. I would like it so if a user has 2 or more roles that the folder browsing, file upload, image upload, etc. would be a combination of the assigned Role-Profiles rather than 1 of them having a precedence.

Comments

ufku’s picture

Status: Active » Closed (won't fix)

There are too many quantitative values that may confuse administrators while calculating the resulting values by merging one or more profiles. It would be hard to guess the resulting profile for a user with 3 roles.
1 to 1 is simpler thus better.

jerrac’s picture

Ah, I missed this issue when I was searching before. Likely because I was only looking at D7 issues.

hs2323, I have started working on making IMCE allow multiple profiles in the D7 version. My issue is here: #1141606: Allow users with multiple roles to access multiple profiles Though, due to what ufku said, the chances of my work getting committed are slim...

ufku, could you elaborate on what you mean? Users are allowed to have multiple roles by default, it seems strange that you can't also have multiple profiles. Especially since so much of how permissions are configured in Drupal is by letting users be members of multiple roles. Not having that functionality is extremely limiting. Having multiple profiles is an essential feature for my current project. I honestly don't see any way to do without it. So, I would really appreciate it if you would go into greater detail on why IMCE doesn't allow multiple profiles.

ufku’s picture

What i mean is that there are lots of values in a configuration profile, which is not suitable for merging. Quantitative values, on/off checkboxes, image dimensions, thumbnails, folder permissions. It is really hard to merge all these values. In addition to default properties in an IMCE profile, there could be some other values set by other contributed modules and IMCE wouldn't know how to merge them.

If you just want to merge assigned directories, you can define a custom process function in your custom module in order to alter an IMCE profile. Custom process functions are stored in 'imce_custom_process' variable which is an array. See imce_mkdir module to see how it works.

jerrac’s picture

And now I am wondering what I was thinking yesterday... Since the original post was about having a role that has more than one profile... Not letting users who have multiples roles, each with their own profile, see all the profiles. *shakes head at self* What ufku said now makes perfect sense.

Thanks for the response ufku.

jmouse888’s picture

We are running into the same problem where users with multiple roles need to access different directories in each role. The only thing need to be merged are the Directory access in each IMCE profile. Can some one give some more details as how to implement this? maybe in the fore-mentioned "imce_custom_process"? Thanks! oh, btw, we are using imce-6.x-2.x-dev.

mostou’s picture

If you use the same approach as standard Drupal permissions - it is close to straight forward to implement this - permissions grant and not restrict.

Quotas - if 0 then 0 else addition
Permitted file extensions - if x then x else merge lists
Directories - merge permissions by the same approach as Drupal permissions

The tricky part is thumbnails as I see it.

If this can be implemented the weight will no longer be needed.

The major disadvantage with the approach 1 user = 1 IMCE profile is the explosions of roles. For instance instead of just having role1, role2, role3 mapped to profile1, profile2, profile3 you need to have role1, role2, role3, role12, role13, role23, role123 in order to cover all the IMCE profile combinations.

SiFre’s picture

mostou - could you expand on how to do it? I'm stuck on providing access to multiple IMCE profiles to users with multiple roles. I'm on D7. I just want to merge the folders.

izus’s picture

Issue summary: View changes

hi,
i had the same need and i released a contributed module for it.
you may want to try it : https://www.drupal.org/project/imce_multiple_roles_folders