[cvs]
expresso/expresso-web/WEB-INF/src/com/jcorporate/expresso/core/security
User.java
JCorporate Ltd
jcorp at jcorp2.servlets.net
Fri Aug 13 16:26:34 PDT 2004
Update of /home/javacorp/.cvs/expresso/expresso/expresso-web/WEB-INF/src/com/jcorporate/expresso/core/security
In directory jcorp2.servlets.net:/tmp/cvs-serv25490/expresso-web/WEB-INF/src/com/jcorporate/expresso/core/security
Modified Files:
User.java
Log Message:
add utility method
Index: User.java
===================================================================
RCS file: /home/javacorp/.cvs/expresso/expresso/expresso-web/WEB-INF/src/com/jcorporate/expresso/core/security/User.java,v
retrieving revision 1.39
retrieving revision 1.40
diff -C2 -d -r1.39 -r1.40
*** User.java 7 Apr 2004 04:03:42 -0000 1.39
--- User.java 13 Aug 2004 23:26:32 -0000 1.40
***************
*** 1522,1524 ****
--- 1522,1540 ----
}
+ /**
+ * determine whether this user is in this group
+ * @return true if the provided group name is one of the groups that this user is a member of
+ */
+ public boolean isMember(String candidategroupname) throws DBException {
+ boolean result = false;
+ List list = getGroupsList();
+ for (Iterator iterator = list.iterator(); iterator.hasNext();) {
+ String grpname = (String) iterator.next();
+ if ( grpname.equals(candidategroupname) ) {
+ result = true;
+ break;
+ }
+ }
+ return result;
+ }
} /* User */
More information about the cvs
mailing list