Hi
I’m currently working on an application where only certain (active)users are allowed to edit forms and fields.
These users are listed as active and non-active in a view.
I need help with a formula or script that will only allow active users to edit other forms in the database.
This is the formula I’m using in the Hide When of the Edit Button, it hides the button for all users:
@If(@DbLookup( “”: “NoCache” ; “” : “” ;“User Details View”;@Name([CN];@UserName);2) = “No” )
Thank You.
Subject: Changing the EditMode of a form
There are problems with your @If statement, but fixing it won’t actually help. Hiding an Edit button won’t keep people from editing the document; they can just double-click on the document to change it to edit mode. What you really should do is look into using roles and Authors fields. It’s more complex and will provide its own problems, but it’s real security.
Subject: RE: Changing the EditMode of a form
I totally agree, that the proper way to solve the issue of different users having different access levels, need to be done using REAL security, i.e. using a proper ACL, providing access to individuals and groups, possibly assigning Roles too. If access need to be granted on document (rather than database) level, use Readers and/or Authors fields (containing Roles where possible).
In this case, it seems like dividing users into two groups, and granting ACL Editors access to the “active” users, and ACL Readers access to “non-active” users.
For further information about readers and authors fields, refer to the excellent “The Compleat Reader and Author Field Troubleshooter” section of the Forum FAQ
Subject: Changing the EditMode of a form
Thank you all for the responses.
My only problem is that the main user wants to control access to the system instead of using the ACL.All the users have Editor access in the ACL.
So even if users are “active” , some will not be allowed access to some fields and forms.
That’s why I need a way to hide the Edit button when a user is not allowed to edit a certain form.
Subject: But that is NOT SECURE!
Any user with just a little knowledge, could easily bypass that pseudo-security.
If you don’t want to maintain users in the ACL, and don’t want to maintain users in two Groups in the Domino Directory (one for each type), and cannot rely on organisational level (e.g. */Managers/YourOrg) for granting access, then you may as well just tell the users that are not “trusted”, that they must not edit the documents, and that they will be crucified if they do. This is more secure that what you are trying to do.
Try to listen to the advice given to you. We are not trying to make your life more difficult, but telling you the easiest way to implement real security.
Subject: RE: Changing the EditMode of a form
To fix the problem as reported, you shouldn’t really be playing with the form: common practice to let users control who’s in and out of a database (or who can do what) is to grant them editor rights to the groups in the NAB. The groups take names which reflect their role (or if you are super-sophisticated, map to real roles in the database), and the user can take names out or put them in the groups. Yu can then rely on the rest of the feature set to allow you to keep your code & design suitbaly clean.