Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

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

Posted on 2004-08-22
8
Medium Priority
?
200 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
Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

 

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 280 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

On Demand Webinar - Networking for the Cloud Era

This webinar discusses:
-Common barriers companies experience when moving to the cloud
-How SD-WAN changes the way we look at networks
-Best practices customers should employ moving forward with cloud migration
-What happens behind the scenes of SteelConnect’s one-click button

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
IBM Notes offer Encryption feature using which the user can secure its NSF emails or entire database easily. In this section we will discuss about the process to Encrypt Incoming and Outgoing Mails in depth.
In this video, Percona Solution Engineer Rick Golba discuss how (and why) you implement high availability in a database environment. To discuss how Percona Consulting can help with your design and architecture needs for your database and infrastr…
In response to a need for security and privacy, and to continue fostering an environment members can turn to for support, solutions, and education, Experts Exchange has created anonymous question capabilities. This new feature is available to our Pr…

715 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