}
role = JetspeedSecurity.getRole(rolename);
}
catch(JetspeedSecurityException e)
{
throw new PermissionException("Failed to Retrieve Role: ", e);
}
Criteria criteria = new Criteria();
criteria.add(TurbineRolePermissionPeer.ROLE_ID, role.getId());
List rels;
HashMap perms;
try
{
rels = TurbineRolePermissionPeer.doSelect(criteria);
if (rels.size() > 0)
{
perms = new HashMap(rels.size());
}
else
perms = new HashMap();
for (int ix = 0; ix < rels.size(); ix++)
{
TurbineRolePermission rel = (TurbineRolePermission)rels.get(ix);
Permission perm = rel.getTurbinePermission();
perms.put(perm.getName(), perm);
}
}
catch(Exception e)
{
throw new PermissionException("Failed to retrieve permissions ", e);
}
return perms.values().iterator();
}