This forum is closed to new posts and responses. Individual names altered for privacy purposes. The information contained in this website is provided for informational purposes only and should not be construed as a forum for customer support requests. Any customer support requests should be directed to the official HCL customer support channels below:

HCL Software Customer Support Portal for U.S. Federal Government clients
HCL Software Customer Support Portal


Mar 27, 2015, 2:51 PM
34 Posts

Replication formula using NotesReplicationEntry not saved when ACL is set to Reader

  • Category: Application Development
  • Platform: Windows
  • Release: 9.0.1
  • Role: Administrator,Developer,End User
  • Tags:
  • Replies: 7

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?

Mar 28, 2015, 2:54 PM
31 Posts
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. 

Mar 31, 2015, 7:31 AM
34 Posts
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.

Apr 1, 2015, 2:23 PM
31 Posts
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.

Apr 2, 2015, 6:57 AM
34 Posts
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.

Apr 2, 2015, 5:02 PM
31 Posts
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.

Apr 2, 2015, 10:35 PM
212 Posts
Need editor access to ACL to make changes

In order to make changes you need Editor Access to the ACL as a minimum.

Apr 2, 2015, 10:35 PM
212 Posts
Need editor access to ACL to make changes

In order to make changes you need Editor Access to the ACL as a minimum.


This forum is closed to new posts and responses. Individual names altered for privacy purposes. The information contained in this website is provided for informational purposes only and should not be construed as a forum for customer support requests. Any customer support requests should be directed to the official HCL customer support channels below:

HCL Software Customer Support Portal for U.S. Federal Government clients
HCL Software Customer Support Portal