How to turn on DeepSee flag on Web App
To set up Web Application, I need to turn on the DeepSee flag using Caché ObjectScript. How can i do it?
Discussion (6)0
Comments
See class documentation for Security.Applications.
Example:
Class DC.Demo.DeepSeeEnable
{
ClassMethod SetDSFlag(pApplicationName As %String, pValue As %Boolean = 1) As %Status
{
Set tSC = $$$OK
Try {
New $Namespace
Set $Namespace = "%SYS"
Set tApplication = ##class(Security.Applications).%OpenId(pApplicationName,,.tSC)
If $$$ISERR(tSC) {
Quit
}
Set tApplication.DeepSeeEnabled = pValue
Set tSC = tApplication.%Save()
} Catch e {
Set tSC = e.AsStatus()
}
Quit tSC
}
}
Use:
USER>s sc = ##class(DC.Demo.DeepSeeEnable).SetDSFlag("/csp/user",1)
USER>w sc
1Thank you very much!
Some of such configuration classes contains methods Modify and Get, it may help to easy modify configuration, in a few lines
set props("DeepSeeEnabled")=1
set sc=##class(Security.Applications).Modify("/csp/myapp", .props)
another option
do EnableDeepSee^%SYS.cspServer("/csp/samples/")
1. Go to: SMP -> Menu -> Web Apps -> Your web app.
2. Click on DeepSee checkbox.
3. Press Save.
The question was how to make it programmatically (via Caché ObjectScript).