sakaiproject/Hilary — pull request #7 by mrvisser (2012-09-05 02:33:14+00:00)
Title: Roles+GroupManagement Adding API methods required to perform group management using the roles module

The key methods are:

**api.SecurityContext.getRolesForObjectType:** Allows the user to get all the roles assigned to a user for all instances of content that is of a particular object type. The result is that you can search for all role associations for a user of object type `ObjectTypes.GROUP`, to get all the groups to which they belong.

**api.getAssociationsForPrincipalsAndObjectType:** Allows the user to perform a multi-get on the roles storage, for a particular `ObjectType`. Multiple multi-gets can be performed until no new groups are found, and this would result in the total group ancestry. An exact example can be found in the tests, where I specifically test this use-case: https://github.com/mrvisser/Hilary/blob/30539733cd2d505e8536f69dedfc0ca1f9aa536c/node_modules/oae-roles/tests/roles.js#L277 . There is no top-level API method for this yet, because I'm still not convinced that the exploding of group membership should happen in the roles module, but instead I think it should be in the group memberships module