Class AllHandsGroupProvider

  • All Implemented Interfaces:
    org.sakaiproject.authz.api.GroupProvider

    public class AllHandsGroupProvider
    extends Object
    implements org.sakaiproject.authz.api.GroupProvider

    AllHands GroupProvider allows the creation of provided authzGroups that automatically include all users.

    To use, set an authzGroup's external id to one of the following:

    • sakai.allhands

    • Constructor Detail

      • AllHandsGroupProvider

        public AllHandsGroupProvider()
        Construct.
    • Method Detail

      • init

        public void init()
        Final initialization, once all dependencies are set.
      • destroy

        public void destroy()
        Cleanup before shutting down.
      • getRole

        public String getRole​(String id,
                              String user)
        Specified by:
        getRole in interface org.sakaiproject.authz.api.GroupProvider
      • getUserRolesForGroup

        public Map<String,​String> getUserRolesForGroup​(String id)
        This is not necessary - because the user has already been added because they are enrolled in the allhand.s
        Specified by:
        getUserRolesForGroup in interface org.sakaiproject.authz.api.GroupProvider
      • getGroupRolesForUser

        public Map<String,​String> getGroupRolesForUser​(String userId)
        If you can do some type of directory lookup to find out some Attribute of this user you could conditionally auto-add them to any number of these "virtual groups" You might try sakai.students, sakai.faculty, sakai.staff, sakai.teamleads There is nothing specific about the string "sakai." these could easily be something like course.eecs280, shib:yale.edu:faculty, or h23.groups.ruk.dk One caveat - this class is respnsbile for handling the unpacking when an admin wants to put in multiple external providers The code below uses the common convention of using "+" (homage to "or") to concatenate IDs. So the user above us could set the provider ID in the Sakai Realms Tool to be h23.groups.ruk.dk+course.eecs280 to indicate thatr membership in either group is OK. To indicate membership in multiple groups in *this routine* add additional entries in the hash map (i.e. do not use the + notation in this routine).
        Specified by:
        getGroupRolesForUser in interface org.sakaiproject.authz.api.GroupProvider
      • getGroupRolesForUser

        public Map getGroupRolesForUser​(String userId,
                                        String academicSessionEid)
        Specified by:
        getGroupRolesForUser in interface org.sakaiproject.authz.api.GroupProvider
      • unpackId

        public String[] unpackId​(String id)
        Specified by:
        unpackId in interface org.sakaiproject.authz.api.GroupProvider
      • packId

        public String packId​(String[] ids)
        Specified by:
        packId in interface org.sakaiproject.authz.api.GroupProvider
      • preferredRole

        public String preferredRole​(String one,
                                    String other)
        Specified by:
        preferredRole in interface org.sakaiproject.authz.api.GroupProvider
      • groupExists

        public boolean groupExists​(String arg0)
        Specified by:
        groupExists in interface org.sakaiproject.authz.api.GroupProvider