Jochen SackJun 24, 2016, 5:22 AM104 PostsWorking as designedNotesACL.getEntry(String) can only find direct entries; see usage notes in Designer Help: "If a person is not listed explicitly in the ACL, but is a member of a group listed in the ACL, getEntry does not find that person's name." A possible workaround is to use NotesSession.evaluate(@UserNamesList), which should return a complete list of the current user's names, roles and groups the user is a member of.
Jochen SackJun 24, 2016, 9:54 AM104 PostsMore infoFirst of all, there's a little (but important) flaw in my suggested workaround in that the quotes are missing around @UserNamesList. Second, it might be necessary to provide a formula context to the evaluate method; i.e., pass a NotesDocument object as second argument. Here's a corrected version: var session:NotesSession = database.getParent(); var doc:NotesDocument = <your code here>; var userNamesList = session.evaluate("@UserNamesList", doc) ;
Abhishek SenGuptaJun 24, 2016, 7:12 AM6 PostsLooking for workaround codeHello Jochen, Thank you very much for your input. I'm very new to Xpages. Could you please provide me part of code that could work with NotesSession.evaluate(@UserNamesList)? Regards, Abhishek SenGupta.
Jochen SackJun 24, 2016, 7:40 AM104 PostsI don't have a complete code example at my fingertips, but......it should be fairly easy to figure out by reading the relevant pages in Domino Designer Help. I'd start with the Help page about the @UserNamesList formula language function, which can be found under "IBM Domino Designer Basic User Guide and Reference", and then proceed with the Help page(s) about the NotesSession class, to be found under "IBM Domino Designer XPages Reference".
L. Berntrop-BosJun 27, 2016, 1:31 AM36 PostsThen again Designer Help is sometimes off. Luckily not all bad.For instance, the help for @UserRoles states that roles for users in groups are not returned. Thankfully, this is untrue and those roles ARE returned. Also, because @UserRoles returns only a subset of @UserNamesList, evaluating formulas using @UserRoles is a lot faster than @UserNamesList.
Jochen SackJun 28, 2016, 4:46 AM104 PostsYou are right, @UserRoles is sufficient if only roles, no groups, matter...which is what the OP's first post indicates indeed, if one takes a closer look at the code. FWIW, the resulting code looks very similar: var session:NotesSession = database.getParent(); var doc:NotesDocument = <your code here>; var userNamesList = session.evaluate("@UserRoles", doc) ;
Abhishek SenGuptaJun 24, 2016, 6:34 PM6 PostsThank you.Thank you very much, Jochen, for all your time and help. I've figured it out and implemented successfully, as you suggested.