Solved

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

Posted on 2004-08-22
8
195 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
Comment Utility
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
Comment Utility
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
Comment Utility
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
 

Author Comment

by:kopibean
Comment Utility
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
What Should I Do With This Threat Intelligence?

Are you wondering if you actually need threat intelligence? The answer is yes. We explain the basics for creating useful threat intelligence.

 

Author Comment

by:kopibean
Comment Utility
Anyone can help on the above?
Thanks
0
 
LVL 19

Expert Comment

by:madheeswar
Comment Utility
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
Comment Utility
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
Comment Utility
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

What Should I Do With This Threat Intelligence?

Are you wondering if you actually need threat intelligence? The answer is yes. We explain the basics for creating useful threat intelligence.

Join & Write a Comment

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
  In today’s Arena we can’t imagine our lives without Internet as we are highly used to of it. If we consider our life style just for only 2 min we found that face to face communication is swapped by e-communication.  Every Where from Works place to…
In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…
Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…

743 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

Need Help in Real-Time?

Connect with top rated Experts

16 Experts available now in Live!

Get 1:1 Help Now