Hello,

I've succesfully installed and run the module. But it only works for the users with the
'administer site configuration' right ?
A simple user cannot see the widget.

Is it possible to change this ?

Thx
Alain

CommentFileSizeAuthor
#2 ldap_entry_reference_permissions.patch1.11 KBalison

Comments

acedel created an issue. See original summary.

alison’s picture

Issue summary: View changes
StatusFileSize
new1.11 KB

Hi Alain! I'm attaching a super preliminary patch that my awesome coworker wrote -- she doesn't have the time to contribute it back thru the proper channels (yet!), but I figured you might like to have it for your own use in the meantime (and anyone else) -- and/or maybe someone else will want to improve it, etc.

EDIT: Oh yeah, there's another reason we weren't going to share it yet, it's based on our copy of the module, which is patched with another local patch related to dn/cn things. Sorry, folks! So I'm removing the file, but here's the file contents, in case it can help you (don't want to give ppl the wrong idea by having a file ending with .patch attached to this issue):

diff --git a/sites/all/modules/contrib/ldap_entry_reference/ldap_entry_reference.module b/sites/all/modules/contrib/ldap_entry_reference/ldap_entry_reference.module
index e8d9162..93c0a51 100644
--- a/sites/all/modules/contrib/ldap_entry_reference/ldap_entry_reference.module
+++ b/sites/all/modules/contrib/ldap_entry_reference/ldap_entry_reference.module
@@ -287,13 +287,24 @@ function ldap_entry_reference_field_is_empty($item, $field) {
 }
 
 /**
+ * Implements hook_permission().
+ */
+function ldap_entry_reference_permission() {
+  return array(
+    'edit ldap_entry_reference field' => array(
+      'title' => t('edit ldap_entry_reference field'),
+    )
+  );
+}
+
+/**
  * Implements hook_field_access()
  * - Control access to ldap entry fields with same permission as "admin/config/people/ldap"
  */
 function ldap_entry_reference_field_access($op, $field, $entity_type, $entity, $account) {
   if ($field['type'] == 'ldap_entry_reference') {
     if ($op == 'edit') {
-      return user_access('administer site configuration', $account);
+      return user_access('edit ldap_entry_reference field', $account);
     }
   }
 }
alison’s picture