if( !AuthorizeManager.authorizeActionBoolean(ourContext, getOwningCollection(), Constants.COLLECTION_ADMIN) )
if( !canEdit() )
    public void update()        throws SQLException, AuthorizeException    {        // Check authorisation                // only do write authorization if user is not an editor        if( !AuthorizeManager.authorizeActionBoolean(ourContext, getOwningCollection(), Constants.COLLECTION_ADMIN) )        {            AuthorizeManager.authorizeAction(ourContext, this, Constants.WRITE);        }                HistoryManager.saveHistory(ourContext,            this,            HistoryManager.MODIFY,            ourContext.getCurrentUser(),            ourContext.getExtraLogInfo());        log.info(LogManager.getHeader(ourContext,            "update_item",            "item_id=" + getID()));        // Set the last modified date        itemRow.setColumn("last_modified", new Date());        	// Set sequence IDs for bitstreams in item	int sequence = 0;	Bundle[] bunds = getBundles();	// find the highest current sequence number	for (int i = 0; i < bunds.length; i++)	{	    Bitstream[] streams = bunds[i].getBitstreams();	    for (int k = 0; k < streams.length; k++)	    {		if (streams[k].getSequenceID() > sequence)		{		    sequence = streams[k].getSequenceID();		}	    }	}	// start sequencing bitstreams without sequence IDs	sequence++;	for (int i = 0; i < bunds.length; i++)	{	    Bitstream[] streams = bunds[i].getBitstreams();	    for (int k = 0; k < streams.length; k++)	    {		if (streams[k].getSequenceID() < 0)		{		    streams[k].setSequenceID(sequence);		    sequence++;		    streams[k].update();		}	    }	}        // Make sure that withdrawn and in_archive are non-null        if (itemRow.isColumnNull("in_archive"))        {            itemRow.setColumn("in_archive", false);        }        if (itemRow.isColumnNull("withdrawn"))        {            itemRow.setColumn("withdrawn", false);        }                // Map counting number of values for each element/qualifier.        // Keys are Strings: "element" or "element.qualifier"        // Values are Integers indicating number of values written for a        // element/qualifier        Map elementCount = new HashMap();        DatabaseManager.update(ourContext, itemRow);        // Redo Dublin Core if it's changed        if (dublinCoreChanged)        {            // Remove existing DC            removeDCFromDatabase();            // Add in-memory DC            Iterator i = dublinCore.iterator();            while (i.hasNext())            {                DCValue dcv = (DCValue) i.next();                // Get the DC Type                DCType dcType = DCType.findByElement(ourContext,                    dcv.element,                    dcv.qualifier);                if (dcType == null)                {                    // Bad DC field, log and throw exception                    log.warn(LogManager.getHeader(ourContext,                        "bad_dc",                        "Bad DC field.  element: \"" +                            (dcv.element == null ? "null" : dcv.element) +                            "\" qualifier: \"" +                            (dcv.qualifier == null ? "null" : dcv.qualifier) +                            "\" value: \"" +                            (dcv.value == null ? "null" : dcv.value) + "\""));                    throw new SQLException( "bad_dublin_core " + dcv.element                                + " " + dcv.qualifier );                }                // Work out the place number for ordering                int current = 0;                                // Key into map is "element" or "element.qualifier"                String key = dcv.element +					(dcv.qualifier == null ? "" : "." + dcv.qualifier);                                Integer currentInteger = (Integer) elementCount.get(key);                                if (currentInteger != null)                {                	current = currentInteger.intValue();                }                                current++;                elementCount.put(key, new Integer(current));                                // Write DCValue                TableRow valueRow = DatabaseManager.create(ourContext,                	"dcvalue");                                valueRow.setColumn("item_id", getID());                valueRow.setColumn("dc_type_id", dcType.getID());                valueRow.setColumn("text_value", dcv.value);                valueRow.setColumn("text_lang", dcv.language);                valueRow.setColumn("place", current);                                DatabaseManager.update(ourContext, valueRow);            }            dublinCoreChanged = false;        }        // Update browse indices        Browse.itemChanged(ourContext, this);    }