* @exception Exception, a generic exception.
*/
public static RoleSet retrieveSet( User user, Group group )
throws Exception
{
Criteria criteria = new Criteria();
/*
* Peer specific methods should absolutely NOT be part
* of any of the generic interfaces in the security system.
* this is not good.
*
* UserPeer up = TurbineSecurity.getUserPeerInstance();
*/
UserPeer up = ((DBSecurityService)TurbineSecurity.getService())
.getUserPeerInstance();
criteria.add(up.getFullColumnName(UserPeer.USERNAME), user.getUserName());
criteria.add(GroupPeer.NAME, group.getName());
criteria.addJoin(up.getFullColumnName(UserPeer.USER_ID), UserGroupRolePeer.USER_ID);
criteria.addJoin(GroupPeer.GROUP_ID, UserGroupRolePeer.GROUP_ID);
criteria.addJoin(UserGroupRolePeer.ROLE_ID, RolePeer.ROLE_ID);
return retrieveSet(criteria);
}