This forum is closed to new posts and responses. Individual names altered for privacy purposes. The information contained in this website is provided for informational purposes only and should not be construed as a forum for customer support requests. Any customer support requests should be directed to the official HCL customer support channels below:

HCL Software Customer Support Portal for U.S. Federal Government clients
HCL Software Customer Support Portal



Feb 20, 2012, 6:28 AM
7 Posts
topic has been resolvedResolved

context.getUser().getRoles()

  • Category: Server Side JavaScript
  • Platform: Windows
  • Release: 8.5.1
  • Role:
  • Tags:
  • Replies: 4
I have alreday log in xpage and setup the database acl.   but   i use contex.getUser().getRoles()    .   I can't get current user 's role.   I use  context.getUser()   ,i only can get this result:
 (fullName: null, name: CN=XXX X XX XXXX/OU=XXXX/O=XXX, mail: null, groups: [], roles: [])   ,i only get the username.  other's is null .I can't find reason.     please give a solution.  many thanks
Feb 20, 2012, 8:19 AM
261 Posts
Re: context.getUser().getRoles()
Hi,
 
The only thing I can think of is that you're working locally and didn't enable the "Enforce a consistent ACL..." option.
 
Mark
Feb 20, 2012, 8:56 AM
7 Posts
Re: context.getUser().getRoles()
Dear Mark:   many thanks . but i have alreday enabled   "Enforce a consistent Access Control List across all"  this option.   but  it is the same .   context.getuser()   (fullName: null, name: CN=Jason Wu /OU=China, mail: null, groups: [], roles: [])   .   I only get user' name .   but the full name ,mail,groups,  roles.   is null. I am very confused.

 
Feb 21, 2012, 6:52 AM
129 Posts
Re: context.getUser().getRoles()
Could be a bug.
 
Try session.evaluate( '@UserRoles' ). Should return an array of all the roles of the user. 
 
If the result is the same as with getRoles, there is probably something else that's wrong. 
Feb 22, 2012, 7:44 AM
7 Posts
Re: context.getUser().getRoles()
Dear Tommy:
 
         use session.evaluate('@UserRoles')   that it is ok  .  but   context.getUser().getRoles() can't  get the current user's role,still.  if it is realted with domino version. Now, I can get user's role with "session.evaluate('@UserRoles')".     Many thanks.

This forum is closed to new posts and responses. Individual names altered for privacy purposes. The information contained in this website is provided for informational purposes only and should not be construed as a forum for customer support requests. Any customer support requests should be directed to the official HCL customer support channels below:

HCL Software Customer Support Portal for U.S. Federal Government clients
HCL Software Customer Support Portal