Solved

Different documents in a view to be open by different authorized person

Posted on 2004-08-22
8
197 Views
Last Modified: 2013-12-18
How do I create my form if I want the different documents inside a view to be open by different authorized people and also specify read or edit access level for each user?
e.g,
for document A, user A,B and C but not user D,E,F(from a names field specify by the user who create the document)can open.In addition, User A and B can edit and User C can read only.
for document B, user D,E,F but not user A,B,C can open.User C can edit and User A and B can read only

Pls advise.
Thank you.
0
Comment
Question by:kopibean
  • 4
  • 4
8 Comments
 
LVL 19

Expert Comment

by:madheeswar
ID: 11867224
create a readers field and assign the preson names to this field who want to read.

And if it is edit rights, then use Authors field  and assign person names.

users can assign the person names manually.
0
 

Author Comment

by:kopibean
ID: 11867539
i would like to prevent reader from switching to the edit mode and also display a message to let reader know that they are only allow to read.

But my code is not working as below:

Sub Querymodechange(Source As Notesuidocument, Continue As Variant)
      Dim db As notesdatabase
      Dim session As New NotesSession      
      Set db = session.CurrentDatabase      
      If Not ( source.EditMode ) Then
            If  Not( source.fieldgettext( "AuthorizedAuthor" )) Then
                  Messagebox _
                  ( "Document available for reading only." )
                  continue = False
            End If
      End If
End Sub

pls advise,thanks!
0
 
LVL 19

Expert Comment

by:madheeswar
ID: 11867568
If Not ( source.EditMode ) Then
          If  source.fieldgettext( "AuthorizedAuthor" )<>session.commonusername Then
               Messagebox _
               ( "Document available for reading only." )
               continue = False
          End If
     End If
'I Assume AuthorizedAuthor field is holding Commonuser name of the persons. if it is multi value field then use Loop:
dim curdoc as notesdocument
set curdoc=Source.document
dim item as notesitem
set item=curdoc.getfirstitem("AuthorizedAuthor")
For x=0 to ubound(item.values)
if session.commonusername<>item.values(x) then
'do nothing
k="no"
else
k="yes"
continue=true
goto memberofgroup
next
msgbox "not a member"
continue=false
end
memberofgroup:
continue=true

0
Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

 

Author Comment

by:kopibean
ID: 11867739
there is an error in the code which I can;t solve -
Unexpected: NEXT ; Expected: END IF

code:
Dim curdoc As notesdocument
      Set curdoc=Source.document
      Dim item As notesitem
      Set item=curdoc.getfirstitem("AuthorizedAuthor")
      If Not ( source.EditMode ) Then
            For x=0 To Ubound(item.values)
                  If session.commonusername<>item.values(x) Then
                  'do nothing
                        k="no"
                  Else
                        k="yes"
                        continue=True
                        Goto memberofgroup
                  Next
                  Msgbox "not a member"
                  continue=False
                  End
memberofgroup:
                  continue=True
            End If      
      End If
      
      
0
 

Author Comment

by:kopibean
ID: 11877285
Anyone can help on the above?
Thanks
0
 
LVL 19

Expert Comment

by:madheeswar
ID: 11879459
use this:
If Not ( source.EditMode ) Then
          If  source.fieldgettext( "AuthorizedAuthor" )<>session.commonusername Then
               Messagebox _
               ( "Document available for reading only." )
               continue = False
          End If
     End If
'I Assume AuthorizedAuthor field is holding Commonuser name of the persons. if it is multi value field then use Loop:
dim curdoc as notesdocument
set curdoc=Source.document
dim item as notesitem
set item=curdoc.getfirstitem("AuthorizedAuthor")
For x=0 to ubound(item.values)
if session.commonusername<>item.values(x) then
'do nothing
k="no"
else
k="yes"
continue=true
goto memberofgroup
end if
next
If k="no" then
msgbox "not a member"
continue=false
end
end if
memberofgroup:
continue=true
0
 

Author Comment

by:kopibean
ID: 11888287
madheeswar,
thanks for ur reply.

i try your amended above solution, but when the username is inside the AuthorizedAuthor field, it give me this msgbox "not a member" thus i am not able to edit.

if the sesson.commonusername is Cindy and in the AuthorizedAuthor field, it appear with Cindy/ABC_Corporation, will it affect?

pls advise again.
thank you very much.
0
 
LVL 19

Accepted Solution

by:
madheeswar earned 70 total points
ID: 11889884
its it effects.
what u can do is:
instead of
sesson.commonusername
use
sesson.Username
or use
sesson.Abbreviatename

Try the above sequence and u will have th result. Since I don't have Client loaded(Changed my employee), I can't test.

But the above will work.
Bye
0

Featured Post

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Lotus Notes 41 208
DAMO - "Overall status" hangs on 0% or 100% even though tranfer has finshed. 3 136
Lotus notes Formula to trigger Lotusscript 1 632
ESXCLI upgrade command 1 116
Problem "Can you help me recover my changes?  I double-clicked the attachment, made changes, and then hit Save before closing it.  But when I try to re-open it, my changes are missing!"    Solution This solution opens the Outlook Secure Temp Fold…
Notes Document Link used by IBM Notes is a link file which aids in the sharing of links to documents in email and webpages. The posts describe the importance and steps to create a Lotus Notes NDL file in brief.
Microsoft Active Directory, the widely used IT infrastructure, is known for its high risk of credential theft. The best way to test your Active Directory’s vulnerabilities to pass-the-ticket, pass-the-hash, privilege escalation, and malware attacks …
A short tutorial showing how to set up an email signature in Outlook on the Web (previously known as OWA). For free email signatures designs, visit https://www.mail-signatures.com/articles/signature-templates/?sts=6651 If you want to manage em…

809 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question