Skip to content

Commit 6b9c0be

Browse files
committed
SetConfigForAllUsers (requires %All role)
1 parent 507cf20 commit 6b9c0be

1 file changed

Lines changed: 22 additions & 1 deletion

File tree

MDX2JSON/Users.cls.xml

Lines changed: 22 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ Can also export/import dettings to/from <b>files</b>.]]></Description>
1111
<Description><![CDATA[
1212
Set <b>App</b> configuration for <b>User</b> equal to <b>Config</b>]]></Description>
1313
<ClassMethod>1</ClassMethod>
14-
<FormalSpec>App:%String,Config:%String,User:%String=$Username</FormalSpec>
14+
<FormalSpec>App:%String,Config:%String="",User:%String=$Username</FormalSpec>
1515
<ReturnType>%Status</ReturnType>
1616
<Implementation><![CDATA[
1717
set ns = $Namespace
@@ -23,6 +23,27 @@ Set <b>App</b> configuration for <b>User</b> equal to <b>Config</b>]]></Descript
2323
]]></Implementation>
2424
</Method>
2525

26+
<Method name="SetConfigForAllUsers">
27+
<Description><![CDATA[
28+
Set <b>App</b> configuration for all <b>Users</b> equal to <b>Config</b>]]></Description>
29+
<ClassMethod>1</ClassMethod>
30+
<FormalSpec>App:%String,Config:%String=""</FormalSpec>
31+
<ReturnType>%Status</ReturnType>
32+
<Implementation><![CDATA[
33+
set ns = $Namespace
34+
zn "%SYS"
35+
return:'($$$IOwnAllRole) $$$ERROR($$$AccessDenied)
36+
37+
set rs=##Class(%ResultSet).%New("Security.Users:List")
38+
set st = rs.Execute()
39+
while rs.Next() {
40+
set st=$$$ADDSC(st,..SetConfig(App, Config, rs.Get("Name")))
41+
}
42+
zn ns
43+
return st
44+
]]></Implementation>
45+
</Method>
46+
2647
<Method name="GetConfig">
2748
<Description><![CDATA[
2849
Get <b>App</b> configuration for <b>User</b>]]></Description>

0 commit comments

Comments
 (0)