Enabling/Disabling roles

In a page I’m hiding two paragraphs with formula language (to create two language interface):!@IsMember(“[EN]”;@UserRoles)

Other one: !@IsMember(“[LT]”;@UserRoles).

Then i put two buttons which one enables EN role, and disables LT role for default user, other one disables EN, enables LT for default user. here’s the code:

Sub Initialize

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( "-Default-" )

Call entry.DisableRole( "LT" )

Call entry.EnableRole( "EN" )

Call acl.Save

End Sub

but when i preview the page in explorer, roles don’t change, and language is the same as in the beginging. What is the problem? Is there any problem in the agent?

Subject: it’s the way Notes caches

You’ll need to close Notes and reopen it to get the ACL to reset. Also, you need to make sure you have “Enforce consistent ACL across all replicas” set if this is a local replica.

Subject: Is there any oter way to enable/ disable roles on real time?

Subject: you’d have to clear security information

Not really. Roles aren’t meant to be changed for a user during their session. I would reconsider the implementation if this is a requirement.