MDL-45678 mod/assign/submission/comments: Improve performance for permissions checking