operation = manager.saveOperation( operation );
operations.put( operation.getName(), operation );
}
permission.setOperation( operation );
Resource resource = permission.getResource();
if ( resources.containsKey( resource.getIdentifier() ) )
{
resource = (Resource) resources.get( resource.getIdentifier() );
}
else if ( manager.resourceExists( resource ) )
{
resource = manager.getResource( resource.getIdentifier() );
resources.put( resource.getIdentifier(), resource );
}
else
{
resource = manager.saveResource( resource );
resources.put( resource.getIdentifier(), resource );
}
permission.setResource( resource );
permission = manager.savePermission( permission );
permissionMap.put( permission.getName(), permission );