public boolean hasRole(String username, String roleName, String groupName)
throws JetspeedSecurityException
{
StringTokenizer st;
LDAPUser user;
try
{
if (cachingEnable)
{
CachedAcl acl = JetspeedSecurityCache.getAcl(username);
if (null != acl)
{
return acl.hasRole(roleName, groupName);
}
}
user = (LDAPUser)JetspeedSecurity.getUser(new UserNamePrincipal(username));
}
catch(JetspeedSecurityException e)
{
throw new RoleException("Failed to Retrieve User: ", e);
}
try
{
for (Enumeration enum1 = user.getGroupRoles().elements(); enum1.hasMoreElements();)
{
st = new StringTokenizer((String)enum1.nextElement(),",");
String gn = st.nextToken();
String rn = st.nextToken();
if (rn.equalsIgnoreCase(roleName) && gn.equalsIgnoreCase(groupName))