Link to home
Start Free TrialLog in
Avatar of Member_2_8206019
Member_2_8206019

asked on

Access control in XPages

There is a DB which contains some XPages.

End-users accesses http;//www.xpage.com/usersettings.xsp to set personal settings.
Admin-users accesses http;//www.xpage.com/adminsettings.xsp to set system setttings.

In this case, how to design XPages security? The Notes DB has [Admin] role which represents Admin users.
I'd like to hide to access the admin setting XPage from end-users and set the documents security (like $Author field) . Is it possible?
Avatar of Sjef Bosman
Sjef Bosman
Flag of France image

You can find out what roles someone has, and hide some elements when the required role isn't there. Try with
roles= session.evaluate("@UserRoles");
isAdmin= roles.contains("[Admin]");

Open in new window


Usually, access to documents is done using Reader and Author fields. They work exactly the same as in Notes.

$Author field: is that your own field? You should never define fields starting with a '$', these names are reserved for internal use.
This question needs an answer!
Become an EE member today
7 DAY FREE TRIAL
Members can start a 7-Day Free trial then enjoy unlimited access to the platform.
View membership options
or
Learn why we charge membership fees
We get it - no one likes a content blocker. Take one extra minute and find out why we block content.