I used to be able to prevent users from copying/pasting documents at the view level as follows:
-
Users did not have Delete access in the ACL
-
A paste agent would delete any document pasted into the view
Unfortunately, now with R6., the users are able to copy/paste documents again because the agent that used to delete them as soon as they were pasted into the view, won’t run for them anymore (it says they don’t have the ability to delete documents, which is true)
I tried using the ACL setting preventing them from copying/replicating, which worked, except that then they could no longer copy/paste data to the clipboard nor print out their documents.
Does anyone know of a way to prevent users from copying/pasting documents without granting them Delete access at the ACL level?
Any help on this topic would be greatly appreciated.
Thanks.
Donna
Subject: How to prevent users from copying/pasting documents in view?
You can put some code into the querypaste event of your views which will stop pasting there.
Subject: RE: How to prevent users from copying/pasting documents in view?
But wouldn’t the code still be @DeleteDocument? They cannot execute that because they do not have the right to delete documents in the ACL.
If that wasn’t what you meant, could you please provide the actual code you’re speaking of?
Thanks very much.
Subject: RE: How to prevent users from copying/pasting documents in view?
There’s no document deletion going on because the new documents aren’t being created in the first place. Find a view and look for the QueryPaste event. Put in some code like this:
Msgbox(“Naughty user!”)
Continue = False
Save the view, then try to copy and paste a document in it. You’ll get a scolding message and no new document. What the continue=false line does is to tell Notes not to continue with the paste operation. You don’t have to delete because the initial paste never actually happens.
Subject: How to prevent users from copying/pasting documents in view?
Did you try setting the agent to run on behalf of a different user, like an admin who has delete rights to the db?
Subject: THANK YOU ALL!!!
I can’t believe it was that simple! I was completely overthinking the entire problem and looking for some really complicated answer… I feel like such a numbskull! :^D
Thanks again everyone!
Donna
Subject: RE: THANK YOU ALL!!!
Sometimes the simple solutions are right in front of us and we do not see it because we think a simple solution cannot exist.
And then we overcode ourselves to death!
Subject: How to prevent users from copying/pasting documents in view?
Continue = False in the view’s QueryPaste should do it.
Subject: BUT wait! With just that in the Query Paste event
won’t she lose her own rights to paste in? I just tested this in one of my databases that uses the same code as Stan’s: I get the message, though I am a manager. Would she not have to add something to the database script that would put a variable in her notes.ini file to allow her to do cut and pastes herself, without having to change her ACL or view formulae to do so?
Subject: RE: BUT wait! With just that in the Query Paste event
Yes, but one has to assume a bit of common sense here, doesn’t one? Obviously, false should evaluate conditionally (based, probably, on NotesDatabase.QueryAccess).
Subject: RE: BUT wait! With just that in the Query Paste event
won’t she lose her own rights to paste in?
Correct, although she didn’t say that she needed to prevent some users but not others from copy/pasting in views. If I had to build that in, I’d probably build a role and do something inside the code checking for membership.
Subject: RE: BUT wait! With just that in the Query Paste event
yes, that is what I did, myself. But I thought perhaps there was some simpler way that I was not aware of … thanks! Cathy
Subject: RE: BUT wait! With just that in the Query Paste event
The code we have suggested is bare bones code.
You can expand it to do whatever you want to your hearts desire, such as checking for a role before kicking them out.
Dim session As New NotesSession
Dim db As NotesDatabase
Dim acl As NotesACL
Dim entry As NotesACLEntry
Set db = session.CurrentDatabase
Set acl = db.ACL
Set entry = acl.GetEntry( “User Name” )
If entry.IsRoleEnabled( “[CanCopy]” ) Then
Continue=True
else
Messagebox “NaughtyPerson”
continue=false
end if
Subject: How to prevent users from copying/pasting documents in view?
Have you looked at the QueryPaste event?
Subject: RE: How to prevent users from copying/pasting documents in view?
What code would you enter into the QueryPaste event? I can’t use @DeleteDocument because the users do not have the ability to delete documents in the database. That option is shut off for them in the ACL.
Code anyone??? 
Subject: RE: How to prevent users from copying/pasting documents in view?
Sub Querypaste(Source As Notesuiview, Continue As Variant)
Messagebox “Documents cannot be copied”
continue=False
End Sub
Subject: oah, and this little thing…
in the ACL, disable their right to create personal or shared views, or this can be bypassed.