generated from intersystems-community/objectscript-docker-template
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Installer.cls
34 lines (30 loc) · 1.02 KB
/
Installer.cls
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
Class App.Installer
{
XData setup
{
<Manifest>
<Default Name="SourceDir" Value="#{$system.Process.CurrentDirectory()}src"/>
<Default Name="Namespace" Value="PYTHON"/>
<Namespace Name="${Namespace}" Create="no">
<Import File="${SourceDir}" Flags="ck" Recurse="1"/>
</Namespace>
<RunInstall Class="App.Installer" Method="DefaultNS"/>
</Manifest>
}
ClassMethod setup(ByRef pVars, pLogLevel As %Integer = 3, pInstaller As %Installer.Installer, pLogger As %Installer.AbstractLogger) As %Status [ CodeMode = objectgenerator, Internal ]
{
#; Let XGL document generate code for this method.
Quit ##class(%Installer.Manifest).%Generate(%compiledclass, %code, "setup")
}
ClassMethod DefaultNS(pVars, pLogLevel, tInstaller) As %Status
{
Set Namespace = tInstaller.Evaluate("${Namespace}")
Do tInstaller.PushNS("%SYS")
For user = "UnknownUser", "Admin", "SuperUser", "_SYSTEM", $username {
Set tProps("NameSpace") = Namespace
Set tSC = ##class(Security.Users).Modify(user, .tProps)
}
Do tInstaller.PopNS()
Quit tSC
}
}