Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Evaluating Group name members with script

Posted on 2004-08-09
3
Medium Priority
?
240 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
[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
3 Comments
 
LVL 31

Expert Comment

by:qwaletee
ID: 11755199
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
ID: 11755229
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 1400 total points
ID: 11760967
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

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

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
I thought it will be a good idea to make a post as it will help in case someone else faces these issues. I trust this gives an idea how each entry in Notes.ini can mean a lot for the Domino Server to be functioning properly. This article discusses t…
Visualize your data even better in Access queries. Given a date and a value, this lesson shows how to compare that value with the previous value, calculate the difference, and display a circle if the value is the same, an up triangle if it increased…
Have you created a query with information for a calendar? ... and then, abra-cadabra, the calendar is done?! I am going to show you how to make that happen. Visualize your data!  ... really see it To use the code to create a calendar from a q…

610 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