I am still fairly new to L/N dev and am having trouble with a readers field. No matter what I do it is still letting all users access a form through a view. What I want is that the users without a userrole of [Approver] to see it in the view but not be able to open it and see the detail. So I put in a readers field with the following formula. @If(Field1=Field2;@UserName : “[Approver]”;“[Approver]”)
I also checked and there is no Authors field. Not sure if this has something to do with it but in the properties for the document I don’t see the Readers field. Please help me troubleshoot.
Thanks!!!
Subject: Readers field won’t work
If a readers field prevents you from opening a document, it also prevents you from seeing any trace of it in a view.Your current readers formula, would make the document totally invisible to anyone except curreht user and users with [Approver] role. Note that if an approver edits the document, the original user would no longer be able to see the document, since @Username now represents the approver, unless the readers field is of type “Computed when composed”.
Try looking at the field in the document properties from the view. Field flags should be “READ-ACCESS NAMES”.
For further info on readers fields, see the Forum FAQ section “The Compleat Reader and Author Field Troubleshooter” (link under resources on the right).
Subject: RE: Readers field won’t work
Is there a way to let everyone see it in a view but only let the Creator and certain User roles open it?
Subject: RE: Readers field won’t work
You could do this with LotusScript in the QueryOpen event of the form. However, that’s a level of complexity where it’s very much worth asking why you don’t want people to view these documents.
Subject: RE: Readers field won’t work
It’s a time of database that people need to see what days are being taken off by other people so that they can take off days accordingly but they dont need to see the detail behind it. Is there a way to do that and how would I go about doing that?
Subject: RE: Readers field won’t work
Dennis,
Morten’s point is well made - is this a ‘nice to have’ or a ‘must have’?
If it’s a must-have then there is something you can do. Allow creation of ‘time-off’ documents that don’t appear in any visible view. In the QuerySave event for the ‘time-off’ form, create a dummy document with just enough fields copied over to identify it in a visible view. The dummy form associated with this document should then contain @DbLookups which reference the full documents in a hidden view. If you restrict who can open the dummy form in the query open event, this will alloww you to display the sensitive information in the form without that information being available in the document properties at view level. You might also have to put checks in the hidden view to prevent unauthorised opening, if your users know the trick of opening hidden views. A lot of hassle if it’s just a ‘nice to have’ feature!
hth
Tony
Subject: RE: Readers field won’t work
Create a form that is blank, or that shows only the minimal information that people should see.
Create a view to display the appropriate documents. In the view design, select the Form Formula event, and enter the name of the form you created above (enclosed in quotes). You could make this view publicly available, while setting restrictions on the other views.
When users access this specially crafted view, they will see the documents, but when they open a document from the view, it will display using the custom form, rather than the usual detailed form.
This is not true security, but I think its certainly an easy solution.
Subject: RE: Readers field won’t work
Now, there is a HUGE difference between “don’t need to see”, and “must not see”.
In case it is “don’t need to see”, you can trap either the View event QueryDocumentOpen, and prevent certain users from opening the documents from the view. Alternatively, you could trap the QueryOpen event of the Form used by the documents, and prevent certain users from opening the documents by simply setting Continue = False.
But why be bothered? If users don’t need to see some information, why do anything special. They presumably wouldn’t try to open the documents, and if they do, what would be the problem?
If, on the other hand, it is a matter of “must not see”, then the above approach would not work, since any user could look at field contents by simply looking at the document properties in the view, and bypass any LotusScript event code very easily. So this is NOT a proper security measure.
The only security measure would be to use readers fields, to prevent users from seeing the document at all (view or form).
Search Designer help and/or this forum for examples of how to implement event-handlers.