Everything works fine for the administrator but not for any other role. I have enabled permission for IMCE - what else do I need to enable?

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

danharper’s picture

I also have this problem, I have set the sample profile to authenticated user but it just doesn't work, I have also created a new profile with the same settings and allocated that to the authenticated user.

I have checked the permissions of all the directories and everything seems ok.

Cheers Dan

kreynen’s picture

Title: Permissions to add IMCE button to WYSIWYG Profile requires access to at least 1 IMCE profile » Permissions

I'm not sure if this is actually the issue @nielsprins and @danharper had configuring IMCE w/ WYSIWYG, but adding to this issue since enabling the IMCE button in the WYSIWYG profile configuration as a user other that UID 1 can be problematic.

I'm changing this to a bug since the module assumes that the user configuring the profile in WYSIWYG has access to at least 1 IMCE profile. If not, the option to enable the IMCE button in the WYSIWYG configuration doesn't even appear. Configuring IMCE w/ WYSIWYG always works for UID 1 since IMCE creates a profile for that users by default, but on sites that are configured by several users in an Administrator role, they may not both to configure IMCE for themselves... especially if admins don't use WYSIWYG.

The problem is with the way imce_wysiwyg checks permissions. It uses module_invoke('imce', 'access')...

/**
 * Implements hook_wysiwyg_plugin().
 */
function imce_wysiwyg_plugin($editor, $version) {
  static $integrated = array();

  if (!module_invoke('imce', 'access')) {
    return;
  }

I added a check to see if the user had permission to 'administer filters' as well since that's what the WYSIWYG module uses to control access to the profile configuration. My logic being if you have access to configure WYSIWYG at admin/config/content/wysiwyg, you should have access to add the IMCE button to profiles even if you aren't a member of a role with access to an IMCE profile.

changed...

if (!module_invoke('imce', 'access')) {

to...

if (!module_invoke('imce', 'access') || !user_access('administer filters')) {

Patch to follow

kreynen’s picture

Title: Permissions » Permissions to add IMCE button to WYSIWYG Profile requires access to at least 1 IMCE profile
Version: 7.x-1.0 » 7.x-1.x-dev
Category: support » bug
FileSize
420 bytes
kreynen’s picture

Title: Permissions » Permissions to add IMCE button to WYSIWYG Profile requires access to at least 1 IMCE profile
Status: Active » Needs review
FileSize
499 bytes

The first patch resulted in the IMCE button showing up in admin/config/content/wysiwyg AND in the WYSIWYG editor even if an IMCE profile wasn't configured for the user. If you clicked on the IMCE button, you where given an Access Denied message from /imce. By returning TRUE for users that have the 'administer filters' permission, but don't have an IMCE profile we get the desired behavior. An admin user who isn't in a role with an IMCE Profile can configure IMCE in the WYSIWYG, but won't see the button when using a WYSIWYG.