Skip to content

Commit f3cea95

Browse files
committed
Added execute rights to user created during install
1 parent 7708fd5 commit f3cea95

1 file changed

Lines changed: 34 additions & 0 deletions

File tree

MDX2JSON/Installer.cls.xml

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,8 @@ todo add optional parameter WEBAPP to Alter web app name if it needs to have ano
6666
</User>
6767
<RunInstall Class="MDX2JSON.Installer" Method="GrantSelectToUserInstaller"/>
6868
<Log Text="User modifyed/created and granted SELECT access to all tables in ${Namespace}" Level="0"/>
69+
<RunInstall Class="MDX2JSON.Installer" Method="GrantExecuteToUserInstaller"/>
70+
<Log Text="User modifyed/created and granted Execute access to all procedures in ${Namespace}" Level="0"/>
6971
</IfDef>
7072
<IfNotDef Var="Password">
7173
<Log Text="You specified username but not a password" Level="0"/>
@@ -402,5 +404,37 @@ Grant select access to User to all tables in comma-separated list of namespaces<
402404
return st
403405
]]></Implementation>
404406
</Method>
407+
408+
<Method name="GrantExecuteToUserInstaller">
409+
<Description>
410+
Grant select access to User to all tables in comma-separated list of namespaces</Description>
411+
<ClassMethod>1</ClassMethod>
412+
<FormalSpec>pVars,pLogLevel,tInstaller</FormalSpec>
413+
<ReturnType>%Status</ReturnType>
414+
<Implementation><![CDATA[
415+
set user=pVars("User")
416+
set namespace= pVars("Namespace")
417+
return ..GrantSelectToUser(user,namespace)
418+
]]></Implementation>
419+
</Method>
420+
421+
<Method name="GrantExecuteToUser">
422+
<Description>
423+
Grant select access to User to all tables in comma-separated list of namespaces</Description>
424+
<ClassMethod>1</ClassMethod>
425+
<FormalSpec>User:%String,NamespacesList:%String="*"</FormalSpec>
426+
<ReturnType>%Status</ReturnType>
427+
<Implementation><![CDATA[
428+
set:NamespacesList="*" NamespacesList=..GetNSList()
429+
set basens=$Namespace
430+
set st = $$$OK
431+
for i=1:1:$l(NamespacesList,",") {
432+
zn $p(NamespacesList,",",i)
433+
set st = $$$ADDSC(st,$SYSTEM.SQL.GrantObjPriv("EXECUTE","*","STORED PROCEDURES",User))
434+
}
435+
zn basens
436+
return st
437+
]]></Implementation>
438+
</Method>
405439
</Class>
406440
</Export>

0 commit comments

Comments
 (0)