Solved

Evaluating Group name members with script

Posted on 2004-08-09
3
225 Views
Last Modified: 2013-12-18
Hi Guys

The users go into a database and can see only their own documents. The ACL says reader/no roles for group name. The documents say that feild x has the persons name in it and it is a 'Readers type field.
However the user can go into edit (button/double click/ctrl-e), make changes but gets rejected when they try to save the changes. This is a good thing but how do I keep them from getting into edit. Code in the QueryModeChange??

I think the problem has to do with evaluating Group name members with script.

0
Comment
Question by:imjamesw
3 Comments
 
LVL 31

Expert Comment

by:qwaletee
Comment Utility
They could have access through some other ACL entry, or there could be a chacheing issue on either client or server.

Restart the server, shut down the clients, and delete teh cache.dsk from all clients.
0
 

Author Comment

by:imjamesw
Comment Utility
The records are created by an agent

The users are only readers

The ACL checks out OK
0
 
LVL 19

Accepted Solution

by:
madheeswar earned 350 total points
Comment Utility
try below code:

Sub Querymodechange(Source As Notesuidocument, Continue As Variant)
            Dim session As New notessession
      Dim item As notesitem
      Dim doc As notesdocument
      Dim result As Variant
      Dim macro As String
      
      Set doc=Source.document
      user=session.commonusername
      
      user_roles =Evaluate("@UserNamesList")
'this is for roles:
      Forall role In user_roles
            
            If ( role = "[Admin]")  Or (role="[Manager]") Or (role="[Partners]") Or (role="[Secretary]") Then
                  
                  continue=True
                  Exit Sub
            End If
            
      End Forall
      
      Dim readitem As notesitem
      Set readitem=doc.Getfirstitem("readers") 'to get user names from a field saved in the document      
      For x=0 To Ubound(readitem.values)
            If user=readitem.values(x) Then
                  continue=True
                  Exit Sub
            End If
      Next
      doc.SaveOptions="0"
      Msgbox "You are not authorized to edit this document",64,"Information"
      continue=False
      Exit Sub
      'Call Source.close
      End      
End Sub
0

Featured Post

6 Surprising Benefits of Threat Intelligence

All sorts of threat intelligence is available on the web. Intelligence you can learn from, and use to anticipate and prepare for future attacks.

Join & Write a Comment

For Desktop Techs: How to retain a user's Notes configuration data when swapping out the end user's computer. (Assuming that you are not upgrading to a completely different version of Notes client) All you need to do is: 1) install Notes o…
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.
This video discusses moving either the default database or any database to a new volume.
In this tutorial you'll learn about bandwidth monitoring with flows and packet sniffing with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're interested in additional methods for monitoring bandwidt…

771 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

10 Experts available now in Live!

Get 1:1 Help Now