Implemented user login and permissions