throw new AuthorizeException("Authorization denied for action " + myaction + " by user " + userid);
{ System.out.println( HistoryManager.getStackTrace() );  throw new AuthorizeException("Authorization denied for action " + Constants.actiontext[myaction] + "on " + Constants.typetext[otype] + ":" + oid + " by user " + userid); }
    public static void authorizeAction(Context c,Object myobject, int myaction)        throws SQLException, AuthorizeException    {        int otype;        int oid;        int userid = -1;  // -1 is anonymous        // now figure out the type and object id        if( myobject instanceof Item )        {            otype = Constants.ITEM;            oid   = ((Item) myobject).getID();        }        else if( myobject instanceof Bitstream )        {            otype = Constants.BITSTREAM;            oid   = ((Bitstream) myobject).getID();        }        else if( myobject instanceof Collection )        {            otype = Constants.COLLECTION;            oid   = ((Collection) myobject).getID();        }        else if( myobject instanceof Community )        {            otype = Constants.COMMUNITY;            oid   = ((Community) myobject).getID();        }        else if( myobject instanceof Bundle )        {            otype = Constants.BUNDLE;            oid   = ((Bundle) myobject).getID();        }        else        {            throw new IllegalArgumentException("Unknown object type");        }        // now set the userid if context contains an eperson        EPerson e = c.getCurrentUser();        if( e != null ) userid = e.getID();        if (!authorize(c,otype,oid,myaction, userid))            throw new AuthorizeException("Authorization denied for action " + myaction + " by user " + userid);    }