How would I go about modifying this module so that I could assign (access control) permissions to another user to access the ldap administration pages?

I have tried to include permissions in 'function ldap_integration_settings()', following on the documentation in the drupal handbook: http://drupal.org/node/22797, but to no avail.

Comments

pablobm’s picture

You can do that giving users access to "administer site configuration".

If you wish a finer-grain configuration, you probably need to give those users access to "access administration pages" and then play with hook_perm() as well as the mentioned hook_settings(). (I think).

rout’s picture

Thanks Pablo,

I did want finer permission to access this module, in fact only to access this module and none of the others.

I've added the perm() function at the start of the module:

function ldap_integration_perm() {
  return array('access ldap');
} 

And I've tried to add the settings() function:

function ldap_integration_settings() {
if (user_access("access ldap")) {
      return message_access();
  }
}

But I'm not sure where to plug this, as there is already a settings() function called in the module:

function ldap_integration_settings($section = 'server') {
...

Anyway, I had hoped there might have been an easy way to do this, but I'm not so sure...

rout’s picture

Still having trouble with this...does anyone have any idea where I would place the following code (as per http://drupal.org/node/22797):

function ldap_integration_settings() {
if (user_access("access ldap")) {
      return message_access();
  }
}

It appears to be returning an error because this function is already called:

function ldap_integration_settings($section = 'server') {

But I'm not sure where I'm going wrong...

rout’s picture

Title: how to add permissions for access... » how to add specific access permissions...
Category: support » feature

I suppose this should be filed as a feature request...

pablobm’s picture

Title: how to add specific access permissions... » Specific permissions to access LDAP configuration
Assigned: Unassigned » pablobm
Status: Active » Postponed
johnbarclay’s picture

Status: Postponed » Closed (won't fix)