Skip to page contentSkip to chat
ServiceNow support
    • Community
      Ask questions, give advice, and connect with fellow ServiceNow professionals.
      Developer
      Build, test, and deploy applications
      Documentation
      Find detailed information about ServiceNow products, apps, features, and releases.
      Impact
      Accelerate ROI and amplify your expertise.
      Learning
      Build skills with instructor-led and online training.
      Partner
      Grow your business with promotions, news, and marketing tools
      ServiceNow
      Learn about ServiceNow products & solutions.
      Store
      Download certified apps and integrations that complement ServiceNow.
      Support
      Manage your instances, access self-help, and get technical support.
g_user.hasRole is returning false if users have external roles - Support and Troubleshooting
  • >
  • Knowledge Base
  • >
  • Support and Troubleshooting (Knowledge Base)
  • >
  • g_user.hasRole is returning false if users have external roles
KB0711977

g_user.hasRole is returning false if users have external roles


8078 Views Last updated : Feb 21, 2023 public Copy Permalink English (Original)
  • English (Original)
  • Japanese
KB Summary by Now Assist

Issue

g_user.hasRole returns false when users possess external roles. For instance, if a user has both external roles such as snc_external or sn_customerservice.customer, along with an internal role like 'ITIL', the g_user.hasRole function for 'itil' will return false, despite the user actually having that role.

Cause

hasRoles() method returns false because the system considers external users to be without a role

Resolution

Even if the users possess internal roles, the function g_user.hasRoles is indicating false, likely because they also have external roles.

For instance, if a user has roles such as snc_external or sn_customerservice.customer along with any internal role like 'ITIL', the function will still return false. This happens because the system perceives the user as external due to their possession of an external role, and therefore, without any role.

Related Links

Access control list rules

Explicit Roles

KB0965712: Role Management FAQ


The world works with ServiceNow.

Sign in for more! There's more content available only to authenticated users Sign in for more!
Did this KB article help you?
Did this KB article help you?

How would you rate your Now Support digital experience?

*

Very unsatisfied

Unsatisfied

Neutral

Satisfied

Very satisfied

Very unsatisfied

Unsatisfied

Neutral

Satisfied

Very satisfied

What can we improve? Please select all that apply.

What are we doing well? Please select all that apply.

Tell us more

*

Do you expect a response from this feedback?

  • Terms and conditions
  • Privacy statement
  • GDPR
  • Cookie policy
  • © 2025 ServiceNow. All rights reserved.