Solved

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

Posted on 2004-08-22
8
199 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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
VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

 

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: 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.

Question has a verified solution.

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

This is an old article, please see an updated version of this article, located here: http://www.experts-exchange.com/articles/23619/Notes-8-5x-Windows-7-Notes-info-and-tips.html
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…
In this video, viewers will be given step by step instructions on adjusting mouse, pointer and cursor visibility in Microsoft Windows 10. The video seeks to educate those who are struggling with the new Windows 10 Graphical User Interface. Change Cu…
Monitoring a network: how to monitor network services and why? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the philosophy behind service monitoring and why a handshake validation is critical in network monitoring. Software utilized …

630 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