public void reconfigure ( SecurityConfig config ) { this . config = config ; LOGGER . debug ( "reconfiguring with {} rules" , config . getRules ( ) . size ( ) ) ; Map < String , Map < String , ResourcePermission > > newPermissions = new HashMap <> ( ) ; for ( SecurityRule rule : config . getRules ( ) ) { String resourceType = rule . getResourceType ( ) ; if ( resourceType == null ) { Class < ? > resourceClass = rule . getResourceClass ( ) ; if ( resourceClass != null ) { resourceType = toType ( resourceClass ) ; } } if ( resourceType == null ) { Collection < RegistryEntry > entries = context . getResourceRegistry ( ) . getEntries ( ) ; for ( RegistryEntry entry : entries ) { String entryResourceType = entry . getResourceInformation ( ) . getResourceType ( ) ; configureRule ( newPermissions , entryResourceType , rule . getRole ( ) , rule . getPermission ( ) ) ; } } else { ResourceRegistry resourceRegistry = context . getResourceRegistry ( ) ; RegistryEntry entry = resourceRegistry . getEntry ( resourceType ) ; if ( entry == null ) { throw new RepositoryNotFoundException ( resourceType ) ; } configureRule ( newPermissions , resourceType , rule . getRole ( ) , rule . getPermission ( ) ) ; } } this . permissions = newPermissions ; }
Applies the new configuration to this module .