return newDetails;
if (source != null) {
    public Details transientDetails( IObject obj )    {    	    	checkReady("transientDetails");    	    	if ( hasPrivilegedToken( obj ) ) return obj.getDetails(); // EARLY EXIT    	        Details source = obj.getDetails();        Details newDetails = CurrentDetails.createDetails();        if ( source != null )        {        	copyNonNullPermissions( newDetails, source.getPermissions() );        	applyUmaskIfNecessary( newDetails );                                    // users *aren't* allowed to set the owner of an item.            if (source.getOwner() != null                     && ! source.getOwner().getId().equals(                             newDetails.getOwner().getId() ))            {                // but this is root                if ( currentUserIsAdmin() )                {                    newDetails.setOwner( source.getOwner() );                } else {                    throw new SecurityViolation(String.format(                        "You are not authorized to set the ExperimenterID" +                        " for %s to %d", obj, source.getOwner().getId()                         ));                }                            }            // users are only allowed to set to another of their groups            if (source.getGroup() != null && source.getGroup().getId() != null)            {            	// users can change to their own group                if (memberOfGroups().contains( source.getGroup().getId()))                {                	newDetails.setGroup( source.getGroup() );                }                                // and admin can change it too                else if ( currentUserIsAdmin() )                {                    newDetails.setGroup( source.getGroup() );                }                                  // oops. boom!                else {                    throw new SecurityViolation(String.format(                        "You are not authorized to set the ExperimenterGroupID"+                        " for %s to %d", obj, source.getGroup().getId()                         ));                }            }                    }        return newDetails;    }