From 81aca1fdfcc3830aa7dd75357eb081bb3e8ac46a Mon Sep 17 00:00:00 2001 From: webflo Date: Sun, 10 Apr 2011 01:41:14 +0200 Subject: [PATCH] initialize variables with strongarm. --- imce.module | 12 ++++++++++++ 1 files changed, 12 insertions(+), 0 deletions(-) diff --git a/imce.module b/imce.module index fe93a12..e375b8e 100644 --- a/imce.module +++ b/imce.module @@ -203,6 +203,18 @@ function imce_access($user = FALSE) { return TRUE; } + /** + * Workaround for compatibility with strongarm. + * This access callback is invoked before strongarm can + * mainpulate the 'imce_roles_profiles' variable. + * We have to setup this manually if not, the user gets an 'Access denied' + * regardless of his permissions. This only happends if 'imce_roles_profiles' is + * exported via strongarm (in a feature or any other custom module). + */ + if (module_exists('strongarm')) { + strongarm_set_conf(); + } + $roles_profiles = variable_get('imce_roles_profiles', array()); foreach ($roles_profiles as $rid => $role) { if (isset($user->roles[$rid])) { -- 1.7.4.1