code to validate user name and pwd and print permission