0

I'm trying to find out what is my access level in a certain database. There are two functions that are available, db.getCurrentAccessLevel() and db.queryAccess(username). Given the same user (the logged in for the first function and the parameter in the 2nd function), I get two different results. The correct result shows when I use the queryAccess function. But in my understanding, they are basically the same. What is the difference between these functions?

Naveen
  • 6,786
  • 10
  • 37
  • 85
John Bautista
  • 1,480
  • 3
  • 29
  • 60

1 Answers1

3

Check out this paragraph in the help for "getCurrentAccessLevel":

If a program runs on a workstation or is remote (IIOP), CurrentAccessLevel is determined by the access level of the current user. If a program runs on a server, CurrentAccessLevel is determined by the access level of the person who last saved the program (the owner)

If your code runs in an agent via "run" or "runonserver" or e.g. in a WebQuerySave- Agent, then the current Access will be the one of the user who last saved the agent, not of the current user.

Tode
  • 11,795
  • 18
  • 34
  • The tags suggest that this question is about XPages and server-side JavaScript. (Although admittedly, you can't always trust the tags.) – Richard Schwartz Jul 10 '13 at 16:02
  • you're completely right... I must admin, that I'm not sure, what the effective rights are for SSJS – Tode Jul 10 '13 at 16:30
  • Same here. I was stuck in agent-land for a long time with the occasional bit of C API work too, and now I'm mostly doing non-Lotus stuff, so I have very little working knowledge of XPages. – Richard Schwartz Jul 10 '13 at 17:55
  • Sorry for the confusion. They are SSJS function calls. – John Bautista Jul 10 '13 at 19:00