permission = manager.getPermission( permission.getName() );
permissionMap.put( permission.getName(), permission );
}
else
{
Operation operation = permission.getOperation();
if ( operations.containsKey( operation.getName() ) )
{
operation = (Operation) operations.get( operation.getName() );
}
else if ( manager.operationExists( operation ) )
{
operation = manager.getOperation( operation.getName() );
operations.put( operation.getName(), operation );
}
else
{
operation = manager.saveOperation( operation );
operations.put( operation.getName(), operation );
}
permission.setOperation( operation );
Resource resource = permission.getResource();
if ( resources.containsKey( resource.getIdentifier() ) )