AuthorizeManager.addPolicy(ourContext, c, Constants.DELETE, ourContext.getCurrentUser()); AuthorizeManager.addPolicy(ourContext, c, Constants.REMOVE, ourContext.getCurrentUser());
    public void removeSubcommunity(Community c)        throws SQLException, AuthorizeException, IOException    {        // Check authorisation        AuthorizeManager.authorizeAction(ourContext, this, Constants.REMOVE);        log.info(LogManager.getHeader(ourContext,            "remove_subcommunity",            "parent_comm_id=" + getID() + ",child_comm_id=" + c.getID()));        // Remove any mappings        DatabaseManager.updateQuery(ourContext,            "DELETE FROM community2community WHERE parent_comm_id=" +                getID() + " AND child_comm_id=" + c.getID() );        // Is the subcommunity an orphan?        TableRowIterator tri = DatabaseManager.query(ourContext,            "SELECT * FROM community2community WHERE child_comm_id=" +                c.getID());        if (!tri.hasNext())        {            // Orphan; delete it            c.delete();        }    }