Search code examples
xpagesacllotus-dominofont-awesome

How to give public access to files under webcontent in lotus domino


I have a domino application with XPages that i want to be public. So, i set in the ACL the "Default" to Depositor level with read public documents option, so as to make it public.

When i want to use an image resource i go to its properties security tab and i enable the "available to public access users" checkbox.

Now, I want to use font-awesome in my application and i have font-awesome's folder with its subfolders and files under webcontent folder.

How can i make them public? (in a non-public app, font-awesome works normally with font-awesome's folder under webcontent folder)


Solution

  • I simply created an agent to set the flag. You can get the code below. I use it for an Angular app that I have added to the NSF.

    HTH /John

    Edit: Code inserted directly here:

    Option Public
    Option DeclareSub Initialize
    Const APP_DIR = “app/”
    Const FN_PUBLICACCESS = “$PublicAccess”
    Const FLAG_TRUE = “1”
    Dim sess As New NotesSession
    Dim db As NotesDatabase
    Dim nc As NotesNoteCollection
    Set db = sess.currentDatabase
    Set nc = db.CreateNoteCollection(False)
    Call nc.SelectAllDesignElements(True)
    Call nc.BuildCollection
    Dim d1 As Long
    Dim d2 As Long
    Dim title As String
    Dim flagsExt As String
    Dim noteid As String
    Dim nextid As String
    Dim i As Long
    Dim doc As NotesDocument
    noteid = nc.Getfirstnoteid()
    For i = 1 To nc.Count
    ‘get the next note ID before removing any notes
    nextid = nc.GetNextNoteId(noteid)
    Set doc = db.GetDocumentByID(noteid)
    title = doc.GetItemValue(“$title”)(0)
    flagsExt = doc.GetItemValue(“$flagsExt”)(0)
    If LCase(flagsExt) = “w” And Left(LCase(title),Len(APP_DIR)) = LCase(APP_DIR) Then
    d1 = d1 + 1
    If Not doc.Getitemvalue(FN_PUBLICACCESS)(0) = FLAG_TRUE Then
    d2 = d2 + 1
    Call  doc.replaceItemValue(FN_PUBLICACCESS,FLAG_TRUE)
    Call doc.save(True, False)
    Print title & ” – set to allow public access read”
    End If
    End If
    noteid = nextid
    Next
    
    Print nc.count & ” design elements checked. “ & d1 & ” elements found in ‘” & APP_DIR & “‘ and “ & d2 & ” updated to give public access”
    
    End Sub