Solved

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

Posted on 2004-08-22
8
196 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
 

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
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 

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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Notes 8.5.2 application on web 4 204
Work Space in Lotus Notes cannot found 6 166
Domino Server 2 71
Domino Lotus Notes Client 4 67
For users on the Lotus Notes 8 Standard client, this article provides information on checking the Java Heap size and adjusting it to half of your system RAM in attempt to get the Lotus Notes 8.x Standard client to run faster.  I've had to exercise t…
Lack of Storage capacity is a common problem that exists in every field of life. Here we are taking the case of Lotus Notes Emails, as we all know that we are totally depend on e-communication i.e. Emails. This article is fully dedicated to resolvin…
This Micro Tutorial demonstrates using Microsoft Excel pivot tables, how to reverse engineer competitors' marketing strategies through backlinks.
Video by: Mark
This lesson goes over how to construct ordered and unordered lists and how to create hyperlinks.

910 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

22 Experts available now in Live!

Get 1:1 Help Now