Author Only View on the Web

My database is for evaluations of a training class. I do not want people to see ‘other’ people’s documents after saving them. I have individuals entered into the ACL with Author. My document has an Author field but I’m not sure what to put for the computed when composed script. Do you know if this will even work on the web? Do I need to put something in the view and the document? Help please!

Thank you,

Heidi

Subject: Author Only View on the Web

@UserName should be all you need in the Readers field (and you will need a Readers-type field to actually control access to read the document). Use the same formula in your primary Authors field (to allow the document’s creator to edit the doc) – and don’t forget to add a second Authors-type field with an admin role (to make sure the document cannot be “lost”). As for the view, categorize it on the Readers field value (you may find that it’s easier to manage if you use @Name([Abbreviate];ReadersField)) and use the RestrictToCategory option to point the users to their own category. There’s no danger of them seeing other people’s documents – the RestrctToCategory just means that the server only has to compute user access to a limited set of documents, which will improve overall performance.

Subject: RE: Author Only View on the Web

Thank you much. The Authors view works to only let the Authors of the documents see their own documents. Would you please clarify the admin author field for me as the administrators cannot see/read the documents created by the users?

Heidi

Subject: RE: Author Only View on the Web

This is a basic cover-your-butt method in Notes:

  1. create a role in the database ACL called, say, [AdminReaders], and give only your servers that role;

  2. place that role in an Authors field.

Everything works as it did before – except that if anything goes wrong with document access (particularly if a Readers field value is somehow changed to a bad value), a database Manager can temporarily give themselves access to all documents in order to rescue the lost document.

Subject: RE: Author Only View on the Web

Great! Thanks again!! I just have one more problem :frowning: What do I need to do so the Administrators CAN read ALL the documents? I have an ADMIN role, but that doesn’t seem to make a difference. Do I need yet another field in the document for that?

Subject: RE: Author Only View on the Web

The admin role should do it – admin users should have access to all documents that have the role in the Authors field – but you’ll need to use a not-single-category view for admin users to look at other documents with. The simple solution is to remove the RestrictToCategory parameter from the view’s URL.

Subject: RE: Author Only View on the Web

I really appreciate all your help. I’m not sure I’m understanding it all. I have another view for the admin users, but they can’t see any of the documents there either. I’m not familiar with ‘not-single-category’ view. Also, I already left out the ‘RestrictToCategory’ parameter because I wasn’t sure where that went either :frowning:

Subject: RE: Author Only View on the Web

These are existing documents? You will need to add your admin role to the authors field on those documents, then make sure that the field actually is an Authors-type field. You will probably need to use (or have someone else use) Full Access Administration to fix the documents. That will let you see them all. In a view that contains all of the documents, run this agent (set to “Manual from actions list” and “All documents in view”):

Dim s As New NotesSession

Dim db As NotesDatabase

Dim dc As NotesDocumentCollection

Dim doc As NotesDocument

Dim authorItem As NotesItem

Set db = s.CurrentDatabase

Set dc = db.UnprocessedDocuments

Set doc = dc.GetFirstDocument

Do Until doc Is Nothing

Set authorItem = doc.GetFirstItem(“AdminFieldName”)

authorItem.Values = “[AdminRole]”

authorItem.IsAuthors = True

Call doc.Save(True, False)

Set doc = dc.GetNextDocument

Loop

That code can all go into Sub Initialize.

As for RestrictToCategory, that goes onto the end of the URL. If you want to see how it works, click on “Show all my posts” under Member Tools. That will show a view called ShowMyTopicsAllFlatWeb, with the URL looking like this:

http://www-10.lotus.com/ldd/nd6forum.nsf/showmytopicsallflatweb?openview&RestrictToCategory=Heidi+Owens

To see my posts, you’d look at:

http://www-10.lotus.com/ldd/nd6forum.nsf/showmytopicsallflatweb?openview&RestrictToCategory=Stan+Rogers

Subject: RE: Author Only View on the Web

I was finally able to delete the ‘test’ documents (the only existing documents). Where/how do I add the Admin role to the Authors field? The Authors field IS an Authors-type field. Thank you for the explanation of the RestrictToCategory :slight_smile:

Subject: RE: Author Only View on the Web

Make the admin Authors field separate, computed, and give it the formula “[Admin]”. (You can have multiple Readers and Authors fields on a document. Keeping this CYA field separate makes it less likely that the value will ever become invalid.) As long as the documents are created using the form, your [Admin] role will have access.

Subject: RE: Author Only View on the Web

I thought I had been able to delete the other ‘existing’ documents, but I was wrong. They are still there, but even as Admin, I can’t delete them. I tried running your agent, but got a Missing Argument for GETNEXTDOCUMENT error on the almost last line. That agent should have made it possible for me to delete the other documents, right? Now, I tried adding another Admin field (I thought you were telling me to add the Admin role to the other field), but the form won’t let me add any fields. I think I need a vacation. The Create Field is no longer accessible.

Subject: RE: Author Only View on the Web

The form may have become damaged. Try running Fixup on the database first. If you still have a problem, go to the list of forms in Designer and copy it, the new copy may not have the same problem. If that doesn’t work, creating a new copy of the database (File->Database->New Copy; not an OS-level copy) may help. A new copy of the database will not have the old docs because you will not have had access to the docs in order to copy them.

Subject: RE: Author Only View on the Web

I have to save this until tomorrow. I hope you’re still around if things don’t work :slight_smile:

Thank you and have a good evening!

Heidi