Generalized the user access and authorization with userauthorization library. Resolved resulting errors. Fixed event comments.