To make an ldap to og groups authorization module for ldap in drupal 7, here what would need to be done:

simply clone of ldap_authorization_drupal_role module and rework LdapAuthorizationConsumerDrupalRole class as follows:

availableConsumerIDs() - return existing og names or ids as array
createConsumers() - create ogs if allowable
revokeSingleAuthorization() - add a user to an og
grantSingleAuthorization() - remove a user from an og
usersAuthorizations() - return list of ogs a user is in by ids or names

and change the wording in
function ldap_authorization_drupal_role_ldap_authorization_consumer() {
$types['drupal_role'] = array(
'consumer_name' => t('drupal role'),
'consumer_name_plural' => t('drupal roles'),
'consumer_short_name' => t('role'),
'consumer_short_name_plural' => t('roles'),
'consumer_description' => t('A Drupal Role.'),
'consumer_class_name' => 'LdapAuthorizationConsumerDrupalRole',
'consumer_class_file' => 'LdapAuthorizationConsumerDrupalRole.class.php',
'consumer_module' => 'ldap_authorization_drupal_role',
);

return $types;
}

Comments

glennpratt’s picture

Assigned: Unassigned » glennpratt

I'm starting to work on this, adding to my list.

johnbarclay’s picture

Great! I got an email from dayer4b who is also working on this. You 2 should check in with each other.

here is his sandbox:
http://drupal.org/sandbox/dayer4b/1174404

If you do simpletests, the examples in ldap_authorization/tests could be cloned, thinned out, and simply change the drupal role membership tests to og membership tests.

If you don't let me know and I can do this cloning when you have something functional.

glennpratt’s picture

Are you looking for this to be a patch to ldap or hosted as a separate project?

Thanks.

johnbarclay’s picture

I don't care either way. Here are my pros and cons on grouping submodules as a project.

grouped together as one project:
-- pro: easier for users to find and work with ldap modules
-- pro: easier for maintainers to collaborate and help each other out
-- pro: there is a bottleneck in the approval process for new module maintainers
-- con: harder to tag releases unless all the sub modules are at the same stage (beta, rc, etc.)
-- pro: easier to keep sub modules at same stage. We can help each other out more easily.
-- pro: can help avoid duplication, because maintainers would have to agree on new submodules. I think if maintainers made more of an effort to combine modules into projects.
-- con/pro: more maintainers means more communicating and getting along but keeps us in check.
- pro:

Let me know which way you want to go so I can add you as a committer.

Also keep in mind that dayer4b is having some issues with his version that may be tied to the ldap_authorization module not behaving correctly with multiple consumers. If this is an issue I can help debug it and fix any issues with ldap authorization.

johnbarclay’s picture

Version: 7.x-1.x-dev » 7.x-2.x-dev
johnbarclay’s picture

Version: 7.x-2.x-dev » 7.x-1.x-dev
Status: Active » Fixed

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.