I recently realised that my many-to-many plugin has a bug: if you have unsaved edits of a page in a tab (so its locked) and add a many-to-many relation via the plugin, then come back and save your changes, the many-to-many relation is deleted because you override the page with the locked state from your tab. The easy solution for this would be to check in the plugin if the page which should be updated is locked. The problem here is: the plugin uses the same user as the one who edits, so the isLocked function always returns false. (If I get it right, it only returns true if another user locked the page). Is there a way to check if the current user locked a page?