The following code is producing this error:
Notes error: You are not authorized to perform that operation (ORD/qats2.nsf).
This was working fine before R6.5. Here’s the code.
If varName(0) = varUser Then
Dim acl As NotesACL
Dim entry As NotesACLEntry
qarepFlag = "True"
Set acl = db.ACL
Set entry = acl.GetEntry( "QA Reps" )
If entry.IsRoleEnabled( "[QA Rep]" ) Then
entry.CanDeleteDocuments = True
Call acl.Save
End If
This was initially on a button click event in a view. I then tried it via an agent and signed the agent myself (I have manager access to the db).
The QA Reps group has author access without the ability to delete docs. When the agent runs it is suppose to enable the group to delete a document immediatley. The script bombs out on the Call acl.Save. Does anyone have any suggestions?
Thanks,
Tim
Subject: RE: Call acl.Save produces error
I doubt this failure has to do with the Notes version. More likely it’s a difference in the server settings, agent settings, or database ACL levels of the users.
Please describe the context in which the agent runs. Is it a scheduled agent, or is it still run by someone clicking an action button?
If it’s run by someone clicking a button, it runs with that user’s permissions – no matter who signed the agent – unless it’s run via RunOnServer. If it’s someone from the QA Reps group, code run by them can’t change the database ACL because they are not managers.
If it’s run as a scheduled agent or via RunOnServer, access depends on the settings of the server, agent, and database. I think manipulating the database ACL is probably a restricted operation – does the ID that signed the agent have access to run unrestricted agents, and is the checkbox in the agent properties set to allow unrestricted operations in that specific agent?
Incidentally, the task you’re trying to do seems odd to me. Why are you changing the database ACL and needing it to take effect immediately? ACL settings are not supposed to change from moment to moment, but be relatively stable. Are you planning to allow deletion of one document but only after checking the document to make sure it’s OK to delete? Then afterwards you change the ACL back to not allowing deletions? Say it ain’t so, Joe!
That’s not the way to do it. Use agent.RunOnServer to call a server agent, passing it the Note ID of the document to be deleted. The agent can do any necessary checking and then delete the document.