* @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(UserGroupRolePeer.GROUP_ID,
((Persistent)group).getPrimaryKey());
criteria.addJoin(up.getFullColumnName(UserPeer.USER_ID),
UserGroupRolePeer.USER_ID);
criteria.addJoin(UserGroupRolePeer.ROLE_ID, RolePeer.ROLE_ID);
return retrieveSet(criteria);
}