public void setGroups ( final JAASSystem _jaasSystem , final Set < Group > _groups ) throws EFapsException { if ( _jaasSystem == null ) { throw new EFapsException ( getClass ( ) , "setGroups.nojaasSystem" , getName ( ) ) ; } if ( _groups == null ) { throw new EFapsException ( getClass ( ) , "setGroups.noGroups" , getName ( ) ) ; } for ( final Group group : _groups ) { add ( group ) ; } // current groups final Set < Group > groupsInDb = getGroupsFromDB ( _jaasSystem ) ; // compare new roles with current groups (add missing groups) for ( final Group group : _groups ) { if ( ! groupsInDb . contains ( group ) ) { assignGroupInDb ( _jaasSystem , group ) ; } } // compare current roles with new groups (remove groups which are to // much) for ( final Group group : groupsInDb ) { if ( ! _groups . contains ( group ) ) { unassignGroupInDb ( _jaasSystem , group ) ; } } }
The depending groups for the user are set for the given JAAS system . All groups are added to the loaded groups in the cache of this person .