logo

The Right Way to give Right of Way?

In all my years as a Notes developer I have never managed to work out Public Access. I know what it means, I just don't get the implementation. Every time I find myself wanting to use it I have to refer back to the help file. From the documentation, here are the steps involved to make a form Public Access:

  1. Click the Security tab.
  2. Select "Available to Public Access Users."
  3. On a form or subform, create a field.
  4. In the Name field, enter $PublicAccess.
  5. In the Type field, select Text and Computed when composed.
  6. In the Programmer's pane at the bottom of the form, enter "1" as the default value for the field.

Now why, why, why is it not sufficient to just perform steps one and two? Why is this a two part process? Why do we have to tell the form it's Public Access and add this hidden field with its computed value of 1? One or the other maybe. But both! I just don't get it. Has anybody else ever wondered this or am I being stupid?

Comments

    • avatar
    • Alastair
    • Fri 26 Sep 2003 05:56

    The first two steps make the form available to public access users, the other steps make documents composed with this form available to public users.

    Works the same way reader/author fields and form security settings as far as I can see.

    • avatar
    • Jake
    • Fri 26 Sep 2003 06:02

    Alastair - But why can't Notes add this field is what I want to know. If somebody adds a document using a form with this proprty enabled, why can't Notes just add the field of its own accord? Thus saving us this extra step...

    • avatar
    • Peter
    • Fri 26 Sep 2003 06:08

    A long time ago I stopped asking myself "Why, why, why"... it is one of those words that are applicable to many things... but I keep shaking my head though. It is an everyday-returning process, shaking your head for things you see or hear. Just like the woman and the gay man who will be executed by throwing stones to him and her... how big are those stones? how long does it take to kill these pour people and by how many stones.

    What world are we living? Why... and then again: I shake my head...

    • avatar
    • Alastair
    • Fri 26 Sep 2003 06:20

    Fair point Jake - but what would I do if I wanted public users to create documents, and then those documents NOT to be available to them after creation.

    In the current setup I could just leave the $PublicAccess field off the form.

    • avatar
    • Martijn
    • Fri 26 Sep 2003 06:22

    how about this one for logics:

    - default access is 'no access'

    - anonymous has reader

    - my userid is not in the acl or any of the groups in the acl.

    1.if i'm not logged in I have reader access

    2.if i'm logged in to the server(directory) I don't have access

    • avatar
    • Jake
    • Fri 26 Sep 2003 06:23

    Peter - I went through a stage of life (funnily enough when I was a student) where I wanted to know why the world was the way it was. Not any more. However, with software, if nobody ever asked why, then there would be no support calls or bug fixes or usability improvemnts.

    Alastair - Does that work? I'd never even thought about what happened if you left the field off. A bit like being a Depositor then?

    • avatar
    • Alastair
    • Fri 26 Sep 2003 07:05

    I find it very useful in web content management systems.

    I place a checkbox on the content form that switches the value of $PublicAccess between 0 and 1.

    And if I give Anonymous no access with read public documents in the ACL, I can control what Anonymous can see on a document by document basis.

    Not sure how I would do that without using a $PublicAccess field.

  1. I've looked at it the same way as Alastair, to make the form available to public users, is a design decision, but to determine if the document is accessible is down to the $PublicAccess field, which can be computed or later changed. An example might be a wiki, where drafting would be allowed for new docs, revisions to those docs, but someone could then 'publish' the doc and it becomes unchangable.

    • avatar
    • Jake
    • Fri 26 Sep 2003 08:26

    Ok, it's starting to make some sense. It didn't before becuase this scenario isn't offered up. Instead they tell us to set its value to "1" and that's that.

    But even in a drafting mode the average public access user can't edit a document with $PublicAccess="1" set. Can they?

    • avatar
    • Alastair
    • Fri 26 Sep 2003 08:32

    If the user has reader access and write public documents then they can edit any document with $PublicAccess = "1".

    Provided the document's form is available to public access users, of course ;-)

    • avatar
    • Jono
    • Fri 26 Sep 2003 09:52

    Well well well, you learn something new everyday... Cheers Jake/Alastair.

    • avatar
    • Jake
    • Fri 26 Sep 2003 09:54

    Indeed you do. I've been messing round with public access a bit more today and understand it a little better. Still, it's confusing. Why can't we JUST add the field ?

    Apologies for blogging before really thinking.

    • avatar
    • Larry
    • Fri 26 Sep 2003 12:36

    blogging = thinking

    • avatar
    • Scott
    • Fri 26 Sep 2003 12:47

    Maybe --- so that you can create public forms (i.e. change design element), let users create documents with public access. Then remove the design element, old documents are still public (although would have to use different form to view).

    >or<

    perhaps it's so you could create public documents and then take away the form to create them later by removing a simple checkbox on the design form.

    Just thinking in a document-managed frame of mind.

    Remember that Notes has gone through a process of tool vs. application mode several times. This seems to be one of the "tool" features.

  2. Seems like the perfect way to allow an anonymous public user to register to a website. They can fill out the form and we don't care who they are. The document that is created, however, with their name and email addy and dogs name shouldn't be public access because that goes off into our user registration database.

    This makes sense as a possible implementation, but I have to admit - before today - I never would have known how to go about getting this to work.

    Jerry

    • avatar
    • Jaap
    • Sat 27 Sep 2003 07:45

    It can be even more weird however, try to implement $$KeepPrivate in case where you want to override the settings because of printing reasons and not allow people for copying the document (grin)

    • avatar
    • chandra
    • Sun 28 Sep 2003 04:39

    Jake,

    How will domino find out if some one (who supposedly does not have any access to the database) come and create a document with a form.It can know for sure only if something is set at the form property level itself.

    The field comes at the second stage ;that of access to the documents.Also the Form itself can be changed by the use of Form Field.

    Suppose the user who does not have any access to the database enters data through a form A(which has public access;say he gives feedback abt the website) and on saving the Form field is changed to Form B which will later be used by web master for viewing and later assignining it as a task to someone for action.In this scenario when the form itself changes the public access field alone can't help.In the same way just the field alone won't help when an anonymous tries to compose a document,domino would depend on the form property as the presence of the field alone can't help (like you may change the form anytime!!).

    Thanks

    • avatar
    • Rusty
    • Tue 30 Sep 2003 12:14

    I use the public access checkbox to allow users with reader access to open a search form, a form being used as a view template, or a similar scenario. I guess the same thing could be accomplished by giving them author access without the ability to create documents.

    I have only had to use the $publicaccess field a few times. In one case it waS so that users with read access to the database could take a (non-anonymous) survey. It was much easier to add a field to one form than to give them author access to the database and restrict their access on all of the existing forms.

  3. Hi Jake,

    Gee I love this site. It gives me warm fuzzy feelings every time I visit with a Domino issue. You've done a great job.

    I've been a developer since late R2 and to this day I just never seem to find the time or inclination to sit down and work out what the $publicaccess field actually does. Thanks again for shedding light for us mere mortals.

    Lee

    {Link}

  4. I have been a Notes/Domino developer since V3, I had never used the $PublicAccess field before yesterday, and I spent the better part of the day trying to get it to work. This is what I discovered:

    $PublicAccess Fields and Shared fields do not get along. I had a shared field on a form, had Public Access checkbox selected, had Public Access checked on the view I was using. Anonymous set to Not Access with the Read Public Documents checked. I could read the view and see the document, but trying to open with the form caused the authentication dialog to be displayed. So at this point I knew the problem was with the form, and not with the actual Notes document, since I could see it in a view. So after many hours of staring at the form, turning on and off, public access, scratching my head and scouring Notes.Net, It dawned on me to try to turn on Public Access to the shared fields, makes sense, they are design elements like a form, view, page, etc. To my suprise, no checkbox for making the shared field available to Public Access users, I though, no way, Lotus would never over look this, so for grins and giggles, I made the Shared Fields into regular fields, and low and behold, all worked as expected. I just wonder if adding this property to Shared fields will be in Domino (higher than 6.5?).

    Even though these kind of oddities in Notes/Domino just drive me nuts. I am still amazed by what I can do with this wonderful tool.

    Jake, Love the site!

    Don

  5. Has anyone got this to work in a modal dialog box using javascript and IE.

    Or am I being stupid?

  6. Sorry - it's Friday and I'm being stupid again.

Your Comments

Name:
E-mail:
(optional)
Website:
(optional)
Comment:


About This Page

Written by Jake Howlett on Fri 26 Sep 2003

Share This Page

# ( ) '

Comments

The most recent comments added:

Skip to the comments or add your own.

You can subscribe to an individual RSS feed of comments on this entry.

Let's Get Social


About This Website

CodeStore is all about web development. Concentrating on Lotus Domino, ASP.NET, Flex, SharePoint and all things internet.

Your host is Jake Howlett who runs his own web development company called Rockall Design and is always on the lookout for new and interesting work to do.

You can find me on Twitter and on Linked In.

Read more about this site »

More Content