When a user has Reader or Editor access to a local replica of a database he/she is able to set the replication formula for the database using the Notes UI however when using a Lotusscript agent, even when we use a LS call tot the agent with RunOnServer and sign the agent using an administrator ID the replicationformula won’t save. There is no error.
When change the ACL to assign designer or admin rights the formula is saved.
Agent code is like this:
Dim session As New NotesSession
Dim db As NotesDatabase
Dim NRepl As NotesReplication
Dim NReplEnt As NotesReplicationEntry
Dim userName As NotesName
Dim replDB As NotesDatabase
Set db = session.CurrentDatabase
Set replDB = New NotesDatabase( “”, “” )
If replDB.OpenByReplicaID( “”, db.Replicaid ) Then
Set NRepl = db.ReplicationInfo
Set userName = session.CreateName(“CN=TEST/O=DEVELOP”)
Set NReplEnt = NRepl.GetEntry(“-”, username.Canonical, True)
NReplEnt.Formula = {@IsUnavailable(ReplicateFor) | @IsMember(“} & username.Canonical & {”;ReplicateFor)}
Call NReplEnt.Save
Call NRepl.Save
End If
We try to set the replicationformula by lotusscript (or java) depending on a field in the users application profile.
Can anyone confirm this behavior and/or has a solution for this?
Subject: Just remember…
That if you change the formula to include the users name you do that for everyone. You will end up flipping it back and forth and I’m not sure what would happen if two people try to perform this action more or less simultaneously. Could get really messy! The result might be inconsistent at best and perhaps even fatal. It might work in a limited test case but I would be really cautious in a production environment.
Subject: Need editor access to ACL to make changes
In order to make changes you need Editor Access to the ACL as a minimum.
Subject: Need editor access to ACL to make changes
In order to make changes you need Editor Access to the ACL as a minimum.
Subject: Local replica
That is why we want to perform this action on the local replica.
In LS it works fine as long as users are at least designer for that application.
Couldn’t get sessionAsSignerWithFullAccess to work in a local JAVA agent after a few hours of searching the internet for examples and documentation.
Subject: Miss read your post
From a logic process I would think that sessionAsSignerWithFullAccess would not work on the Local copy because I believe it would need to get the FullAccess from the server document, and of course there is no server involved. I’m not absolutely sure of this but believe that is how it works.
Subject: Thank you
Thank you Bill for attending me at this sessionAsSignerWithFullAccess method. Because this is a “old fashion” Notes application I’m going to try to use this in a Java agent.
Subject: I think you will find that …
When the Formula is created & executed in the UI there are not changes to the DB properties, but it is all done in the UI and perhaps saved in some client settings (Not sure about that one) However what you are doing in your script is actually changing a database property and a Reader can not do that. Probably of little help but there is a JavaScript JAVA method sessionAsSignerWithFullAccess that can get around this.
thisDB = sessionAsSignerWithFullAccess.getDatabase(“”,“”);
thisDB.openByReplicaID(serverName,repID);
var ACL:NotesACL = thisDB.getACL();
Now the thisDB object is opened with full rights, and the various DB properties can be modified even if the user has a lower ACL setting, but I’m not aware of a similar LS method.