Is it possible to run entry.DisableRole as Editor user??I can run the code just if the user is MANAGER. But I can’t give Manger Access to a normal user.
Set entry = acl.GetEntry(session.UserName)
Call entry.DisableRole( “ROLE” )
Call acl.Save
The user have the follow message:
“You are not authorized to perform that operation”
Thank you!
Subject: Entry.DisableRole. Is it possible to run with Editor Access??
If the code is in an agent that is signed with an ID with the proper access, then it will work if the person has enough access to run the agent.
Subject: RE: Entry.DisableRole. Is it possible to run with Editor Access??
HI!
I put the code in an agent but how can I do to sign with other ID ??
The code is:
Sub Initialize
Dim session As New NotesSession
Dim workspace As New NotesUIWorkspace
Dim db As NotesDatabase
Dim uidoc As NotesUIDocument
Dim doc As NotesDocument, doc2 As NotesDocument
Set uidoc = workspace.CurrentDocument
Set doc = uidoc.Document
Set db = session.CurrentDatabase
Set view = db.GetView( "FEP" )
Dim username As New NotesName(session.UserName)
Dim acl As NotesACL
Dim entry As NotesACLEntry
Dim retorno As Variant
Set acl = db.ACL
'Disable
Set entry = acl.GetEntry(session.UserName)
Call entry.DisableRole( "ROLE" )
Call acl.Save
uidoc.EditMode = True
Call uidoc.FieldSetText("Sent", "")
Set doc2 = New NotesDocument( db )
Call doc.CopyAllItems( doc2, True )
Numero = uidoc.Document.Revisao
Numero = Val(Numero(0)) + 1
Messagebox "Essa é a versão No.: " & Numero
If Numero < 10 Then
uidoc.Document.Revisao = "0" & Mid(Str(Numero),2)
Else
uidoc.Document.Revisao= Mid(Str(Numero),2)
End If
Call uidoc.FieldSetText("sent", "")
'enable Role
Call entry.enableRole( "ROLE" )
Call acl.Save
Call doc2.Save( True, True )
Call uidoc.Refresh
Call view.refresh
End Sub