r4588 - trunk/src/edu/ucsb/nceas/metacat

daigle at ecoinformatics.org daigle at ecoinformatics.org
Wed Nov 19 15:23:42 PST 2008


Author: daigle
Date: 2008-11-19 15:23:42 -0800 (Wed, 19 Nov 2008)
New Revision: 4588

Modified:
   trunk/src/edu/ucsb/nceas/metacat/AuthSession.java
Log:
Add a getAttributes method to pass through the getAttributes defined in the AuthInterface.

Modified: trunk/src/edu/ucsb/nceas/metacat/AuthSession.java
===================================================================
--- trunk/src/edu/ucsb/nceas/metacat/AuthSession.java	2008-11-19 23:12:14 UTC (rev 4587)
+++ trunk/src/edu/ucsb/nceas/metacat/AuthSession.java	2008-11-19 23:23:42 UTC (rev 4588)
@@ -27,13 +27,16 @@
 package edu.ucsb.nceas.metacat;
 
 import java.net.ConnectException;
+import java.util.HashMap;
+import java.util.Vector;
+
 import javax.servlet.http.HttpSession;
 import javax.servlet.http.HttpServletRequest;
 
 import org.apache.log4j.Logger;
 
 import edu.ucsb.nceas.metacat.service.PropertyService;
-import edu.ucsb.nceas.metacat.util.LDAPUtil;
+import edu.ucsb.nceas.metacat.util.AuthUtil;
 import edu.ucsb.nceas.metacat.util.UtilException;
 
 /**
@@ -174,12 +177,24 @@
 	public String getPrincipals(String user, String password) throws ConnectException {
 		return authService.getPrincipals(user, password);
 	}
+	
+	/**
+	 * Get attributes describing a user or group
+	 * 
+	 * @param foruser
+	 *            the user for which the attribute list is requested
+	 * @returns HashMap a map of attribute name to a Vector of values
+	 */
+	public HashMap<String, Vector<String>> getAttributes(String foruser)
+			throws ConnectException {
+		return authService.getAttributes(foruser);
+	}
 
 	/*
 	 * format the output in xml for processing from client applications
-	 *
-	 * @param tag the root element tag for the message (error or success)
-	 * @param message the message content of the root element
+	 * 
+	 * @param tag the root element tag for the message (error or success) @param
+	 * message the message content of the root element
 	 */
 	private String formatOutput(String tag, String message) {
 		return formatOutput(tag, message, null, null, null, null);
@@ -210,7 +225,7 @@
 
 			try {
 				// insert <isAdministrator> tag if the user is an administrator
-				if (LDAPUtil.isAdministrator(username, groups)) {
+				if (AuthUtil.isAdministrator(username, groups)) {
 					out.append("\n  <isAdministrator></isAdministrator>\n");
 				}
 			} catch (UtilException ue) {
@@ -219,7 +234,7 @@
 			}
 
 			// insert <isModerator> tag if the user is a Moderator
-			if (LDAPUtil.isModerator(username, groups)) {
+			if (AuthUtil.isModerator(username, groups)) {
 				out.append("\n  <isModerator></isModerator>\n");
 			}
 		}



More information about the Metacat-cvs mailing list