Use the runtime module if you want to view runtime settings for the script, the session, or the user.
var userRole = runtime.getCurrentUser().role;
This returns the internal ID of the role for the current user. The supported script types are Client and server scripts.