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

I was very interested in this question! Looking at this really great post here, there was some documentation I wanted to look at but it's giving me access errors :( hoping to read up on the security package documentation soon!

Hello @Evgeny Shvarov ,

I tested the following code in an Iris terminal to add %DB_%DEFAULT role, It seems to work :

Write !,"Current user roles : ",$Roles
Zn "%SYS"
Set tSc = ##class(Security.Applications).Get("/csp/user",.p)
Write !,"Get application : ",$SYSTEM.Status.GetOneErrorText(tSc)
Set p("MatchRoles")=p("MatchRoles")_":%DB_%DEFAULT"
Set tSc = ##class(Security.Applications).Modify("/csp/user",.p)
Write !,"Modify application : ",$SYSTEM.Status.GetOneErrorText(tSc)
Kill p

^^^ Bacon Saver, thank you.

If you are using %INSTALLER, you can use GRANT to assign a role:


I have tested and confirmed that this does add the Application Role.