Solved

Lotus version 6.  What do I need to do to make a form to only be able to open for certain people?

Posted on 2004-09-08
14
263 Views
Last Modified: 2013-12-18
I have a view that displays documents that are created by an agent but I only want certain people to be able to open these documents.  I have tried creating a role and changing the key tab on the form but it is still available to all users.

0
Comment
Question by:sjmmajor
  • 7
  • 5
  • 2
14 Comments
 
LVL 46

Expert Comment

by:Sjef Bosman
ID: 12006866
Are all those people allowed to open all those documents? Are these generated documents in a view together with other documents?
0
 
LVL 24

Expert Comment

by:HemanthaKumar
ID: 12006893
Create Readers type field and populate the role or group in this field.. So only those who are listed in this field can see the doc and open it.

~Hemanth
0
 

Author Comment

by:sjmmajor
ID: 12006923
They are allowed to view other documents in other views and they can view the documents in this view.  I just want only certain people to actually be able to open these particular documents.  Only the generated documents are in this view.
0
 
LVL 46

Expert Comment

by:Sjef Bosman
ID: 12006942
Changing the form won't be enough. The document contains the necessary settings, not the form, it merely displays a document. I suppose you need the following:
- an agent in LotusScript
- create a Readers-field with multiple values
- values "[YourRole]" and "[Manager]" to make sure a Manager can read all documents

Someone without YourRole will not even see the document appear in ANY view.
0
 
LVL 46

Expert Comment

by:Sjef Bosman
ID: 12006982
So they should be allowed to SEE the document in the view, but they are not allowed to OPEN the document in a form? Then you need to do some checking in the QueryOpen-event in the form. If someone lacks YourRole, Continue must be set to False.
0
 

Author Comment

by:sjmmajor
ID: 12007034
sjef - Yes, do you know the script off hand?
0
 
LVL 24

Expert Comment

by:HemanthaKumar
ID: 12007062
sjmmajor,

Then add this script to the queryopen of the doc

Dim session As New NotesSession
Dim acl As NotesACL    
Dim entry As NotesACLEntry

Set db = session.CurrentDatabase
Set acl = db.ACL
Set entry = acl.GetEntry( session.CommonUserName )

If entry Is Nothing Then
  Set entry = acl.GetEntry( session.UserName )
End If

If entry Is Nothing Then
   Msgbox "You are not authorized to open this doc"
   Continue = False
End If

If entry.IsRoleEnabled( "[UserRole]" ) Then
   Msgbox "You are not authorized to open this doc"
   Continue = False
End If
0
IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

 

Author Comment

by:sjmmajor
ID: 12007205
Well I got it to show not authorized but I am in that group.  So I guess is there an If entry.is not role enabled?
0
 
LVL 46

Accepted Solution

by:
Sjef Bosman earned 250 total points
ID: 12007238
Version 6 eh?

Dim session As New NotesSession
Dim v As Variant

Set db = session.CurrentDatabase
v= Evaluate("@UserRoles")
If IsNull(ArrayGetIndex(v, "[UserRole]")) Then
   Msgbox "You are not authorized to open this doc"
   Continue = False
End If

I don't like Evaluate, but it sure comes in handy sometimes...
0
 

Author Comment

by:sjmmajor
ID: 12007459
I changed in your first code to "IF not entry.isroleenabled" and I do get the message on only people not in the role but it also gives and error message "Object Not Set" after it gives the not authorized message.  Your last code I get the Not authroized message myself.  Should I have replaced all of the previous code?  I did but maybe I shouldn't.

0
 

Author Comment

by:sjmmajor
ID: 12007515
Never mind.  In the last code I forgot to change Userrole to the correct name.  The last one worked!!! No errors.  I am going to go around and try the function on some other emails.  

Thanks so much!!
0
 

Author Comment

by:sjmmajor
ID: 12007596
Perfect.  Thanks for your quick responses!  Everything seems to be working.

0
 
LVL 46

Expert Comment

by:Sjef Bosman
ID: 12008799
Hemantha's code is functionally equivalent to mine, you could have given him a piece of the cake.

Thanks!
0
 

Author Comment

by:sjmmajor
ID: 12009230
Your right.  My apologizes.  I get so caught up with what I am doing that I need to remember to revisit all responses.  
0

Featured Post

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

Problem "Can you help me recover my changes?  I double-clicked the attachment, made changes, and then hit Save before closing it.  But when I try to re-open it, my changes are missing!"    Solution This solution opens the Outlook Secure Temp Fold…
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…
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…
This video explains how to create simple products associated to Magento configurable product and offers fast way of their generation with Store Manager for Magento tool.

757 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

18 Experts available now in Live!

Get 1:1 Help Now