public Set < Role > findRoles ( final Group userGroup ) { final Set < Role > result = new HashSet < Role > ( ) ; Object source ; for ( final RoleMapping mapping : this . getRoleMappings ( ) ) { source = mapping . getSource ( ) ; if ( ( userGroup != null ) && userGroup . equals ( source ) ) { result . add ( mapping . getTarget ( ) ) ; } } return result ; }
Finds the roles mapped to given user group .