The GroupManager is a simple application for managing groups of GLAST users. Assigning users to groups allows them to gain special permissions within various GLAST web applications.

Managing Groups

Groups can be managed via the web interface at http://glast-ground.slac.stanford.edu/GroupManager/. You will need to already be in the group GroupManagerAdmin to be able to add/remove people from groups. The web interface allows groups to be created and deleted, and users to be inserted and removed from groups. It also allows groups to be inserted into groups, which is functionally equivalent to adding all the people in the sub-group to the parent group.

The list of users is currently imported from http://glast.stanford.edu/cgi-prot/personal_info.pl and so cannot be modified via the web interface. Currently the import of user data is done manually, although hopefully this can be automated soon.

Two special groups exist:

GlastUser

All glast users will be in this group

GroupManagerAdmin

Users in this group can manage groups

Using the Group Manager in your own applications

Java Applications

To include the library in your web application you must add the following to the dependencies section of your maven file:

project.xml
<dependency>
     <groupId>glast</groupId>
     <artifactId>GroupManager</artifactId>
     <version>1.0</version>
     <type>jar</type>
     <properties>
        <war.bundle>true</war.bundle> 
     </properties>
</dependency>

You can now use the GroupManager functions from your JSP pages like this:

index.jsp
<%@page contentType="text/html"%>
<%@page pageEncoding="UTF-8"%>
<%@taglib uri="http://glast-ground.slac.stanford.edu/GroupManager" prefix="gm" %>
<%@taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>

<html>
    <head>
        <title>Glast Group Manager Example</title>
    </head>
    <body>
    <h1>GLAST Group Manager Example</h1>  
    <p>Welcome to the glast group manager example. This example illustrates how you can use the 
    glast group manager.</p>
    
    <c:set var="userInfo" value="${gm:getUserInfo(pageContext.request.remoteUser)}"/>
        
    <p>Hi ${userInfo.fullName}, would you like an <a href="mailto:${userInfo.EMail}">e-mail?</a><p>
    <ul>
        <c:forTokens items="GlastUser,GroupManagerAdmin" delims="," var="group">
            <li>You ${gm:isUserInGroup(pageContext.request.remoteUser,group) ? "are" : "are not"} in group ${group}.</li>
        </c:forTokens>
    </ul>
</html>

The full example can be found as module org-glast-groupmanager-example in the Glast Java CVS.

Non-Java Applications

The GroupManager has a very simple "web services" interface, to make it possible to use it easily from other languages. The following URL's can be used to query the GroupManager; in each case they return a plain text file with a single line result.

In the first case the returned string is always one of true or false. In the second case the returned string is of the form:

first:last:e-mail:

more infomation may be added beyond the trailing : in future.

  • No labels