Fix obtaining permission object.
Allow passing a notepad id to filter the MODSEQ.