access rights

Help
Robert
2011-08-08
2013-04-25
  • Robert

    Robert - 2011-08-08

    hello…it´s me again ;-)
    i had read here a little bit about access rights…but unfortunately this helps me not enough.
    i want that only that person can see their document that had create it.

    i save the current user in the form in a named field called "creator"
    then i thought i have to add in the "onopenDocument" event something like this:

    <code>
    if plominoDocument.getCurrentUser().getMemberId()==plominoDocument.getItem('creator'):
        return "???"
    </code>

    is this the right way? what have to place in where the three question marks are…the current form?

     
  • Robert

    Robert - 2011-08-08

    and maybe is it possible to generate a view restricted view ?

     
  • Robert

    Robert - 2011-08-08

    i find it out ;-)

    <code>
    if plominoDocument.getCurrentUser().getMemberId()==plominoDocument.getItem('creator'):
        return True
    else:
        return "You are not allowed to view this document."
    </code>

    but is there any way to restrict the view? maybe a searchform?

     
  • Eric Brehault

    Eric Brehault - 2011-09-05

    hello,

    Yes, you must use a search form.
    Views uses the index, and documents are refreshed in the index when they are saved.
    So a view selection based on the current session (the current user or the current date for instance) makes no sense because this formaula is evaluated at save time, not when the view is openned.

    Eric

     

Log in to post a comment.