fixed bug about dns validation and added break to switch..case
created function user_permits which returns user role and labs/school units permissions