· Jul 29, 2019

Printing out System Security Property Values in the Cache Terminal


I am struggling to print out the actual property values of the Security.System class.


I was hoping to be able to print the Authentication Enabled properties of a system from the command line using the Get or GetProperties class method. Currently, however, I am only able to get a return 1 or Invalid Oref error.


I would expect one of these to work, but I think I am missing something. Any tips?

%SYS>w ##class(Security.System).Get("AutheEnabled")


%SYS>w ##class(Security.System).GetProperties("AutheEnabled")

0 {?2<INVALID OREF>zGetProperties+3^Security.System.1<%SYS3)$^zGetProperties+3^Security.System.1 +X^@ +1


I can do an Export from this same class and see the value in the XML file, but I would like to return that specific value from one line of code if possible.



- James

Discussion (5)1
Log in or sign up to continue

Security.System is a persistent class with 1 object in it. The ID of the object is "SYSTEM". So this works

set ss = ##class(Security.System).%OpenId("SYSTEM")
write ss.AutheEnabled

The approach above is best if you want to access several properties. But if all you really want is one or two properties of Security.System, you can do this:

write ##class(Security.System).AutheEnabledGetStored("SYSTEM")

Hey Joel,

One more question in relation to this.

I found the documentation page on the auto-generated method for PropertyGetStored, but how do I know if a class has this auto-generated function available?

For instance, I can use this function for Security.Users:

%SYS> w ##class(Security.Users).EnabledGetStored("jhipp")


But this method does not exist for SYS.Database:

%SYS> w ##class(SYS.Database).MaxSizeGetStored("USER")


Are the auto-gen functions only available to certain classes?

Thanks Again,