< Back

Document Subject: Prevent deletion of documents for all except a certain role
Hint Short Cut: Add this to your code & documentation to help you find this page.
http://#OverrideDeleteForNonAdmins or http://A555F9/nn.nsf/ByAlias/OverrideDeleteForNonAdmins

Allowing deleting on a database can be hazardous, but otherewise the database becomes filled with rubbish. One way is to only allow people with a certain role to do this.




Allow deleting doumments and add a role "DeleteDocs".

 

Sub Querydocumentdelete(Source As Notesuidatabase, Continue As Variant)
   
   Dim nv As Variant
    nv = Evaluate("@implode(@userroles)")
    If Instr(nv(0), "[DeleteDocs]")>0 Then
         Print "User has Delete Docs role, so deleting is ok"
         continue=True
    Else
      Messagebox "You can't delete, please cancel the request." & _

        "You can only delete if you have the [DeleteDocs] role."
         continue=False      
    End If
   
End Sub