~Fred AsatumiburyndsJun 24, 2016, 9:22 AM107 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.
~Fred AsatumiburyndsJun 24, 2016, 1:54 PM107 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) ;
~Pippy NonfreetexettuJun 24, 2016, 11: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.
~Fred AsatumiburyndsJun 24, 2016, 11:40 AM107 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".
~Yentl UmhipibergnivuJun 27, 2016, 5:31 AM40 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.
~Fred AsatumiburyndsJun 28, 2016, 8:46 AM107 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) ;
~Pippy NonfreetexettuJun 24, 2016, 10: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.