AuthorizeManager.authorizeAction(ourContext, this, Constants.DELETE);
if (! AuthorizeManager.authorizeActionBoolean(ourContext, getParentCommunity(), Constants.REMOVE) ) { AuthorizeManager.authorizeAction(ourContext, this, Constants.DELETE); }
    public void delete()        throws SQLException, AuthorizeException, IOException    {        // Check authorisation        AuthorizeManager.authorizeAction(ourContext, this, Constants.DELETE);        // If not a top-level community, have parent remove me; this        // will call delete() after removing the linkage        Community parent = getParentCommunity();        if (parent != null)        {            parent.removeSubcommunity(this);            return;        }        log.info(LogManager.getHeader(ourContext,            "delete_community",            "community_id=" + getID()));        // remove from the search index        DSIndexer.unIndexContent(ourContext, this);        HistoryManager.saveHistory(ourContext,            this,            HistoryManager.REMOVE,            ourContext.getCurrentUser(),            ourContext.getExtraLogInfo());        // Remove from cache        ourContext.removeCached(this, getID());        // Remove collections        Collection[] cols = getCollections();                for (int i = 0; i < cols.length; i++)        {            removeCollection(cols[i]);        }        // Remove subcommunities        Community[] comms = getSubcommunities();                for (int j = 0; j < comms.length; j++)        {            removeSubcommunity(comms[j]);        }        // Remove the logo        setLogo(null);        // Remove all authorization policies        AuthorizeManager.removeAllPolicies(ourContext, this);        // Delete community row        DatabaseManager.delete(ourContext, communityRow);    }