Don't try this at home!
Category XPagesDomino has a refined security system, so the java.policy file can be a real PITA. So you would be tempted to write a few lines of LotusScript and run it on a scheduled agent, so on the next server restart that pain goes away. Of course you wouldn't write code like below which lacks any error handling.You also would not hide this code from your admin people who would want an impact study and your firstborn for any change they make. So instead of doing all this you wait until there is a proper configuration setting for this.
Option Declare
Sub Initialize
Dim s As New NotesSession
Dim inikey As String
Dim secFileName As String
Dim stream As NotesStream
Dim policy As String
Dim beginString As String
Dim endString As String
Dim permission As String
Dim beginPos As Integer
Dim endPos As Integer
inikey = "NotesProgram"
beginString = "grant {"
endString = "}"
secFileName = s.Getenvironmentstring(iniKey, true)
secFileName = secFileName + "jvm/lib/security/java.policy"
permission = "permission java.security.AllPermission;"
Set stream = s.Createstream()
Call stream.Open(secFileName)
policy = stream.Readtext()
beginPos = InStr(policy,beginString)
If beginPos < 1 Then
'We don't have any so we abort
Exit sub
End If
Dim firstCut As String
firstCut = Mid$(policy,beginPos)
endPos = InStr(firstCut,endString)
If endPos < 1 Then
'The file is borked
Exit Sub
End If
Dim allGrant As String
allGrant = Mid$(firstCut,1,endPos)
'Now the check
If InStr(allGrant,permission) < 1 Then
'We need to update the file
Call stream.Truncate()
Call stream.Writetext(Mid$(policy,1,beginPos+7), EOL_NONE)
Call stream.Writetext(permission, EOL_PLATFORM)
Call stream.Writetext(Mid$(policy,beginPos+7), EOL_NONE)
End If
Call stream.Close()
End Sub












Category 




















