In ServiceNow, the admin role includes all other roles implicitly. So if a user has admin, g_user.hasRole( ' any_role ' ) returns true. From ServiceNow Docs - g_user API: "The hasRole() method returns true if the user has the specified role or is an admin."