Question
· May 17, 2020

How to create workflow users and roles programmatically?

Hi Community!

Do you know how to create workflow users and roles programmatically?
I use Docker for test deploy and I need to set up IRIS Interoperability using the install script.

Maybe do you know how to import/export already existing workflow users and roles?

Discussion (7)2
Log in or sign up to continue

There are multiple ways, just use Create method directly on classes Security.Roles, and Security.Users

do ##class(Security.Roles).Create(Name, Description, Resources, GrantedRoles)
do ##class(Security.Users).Create(UserName, Roles, Password)

Or, you can use %Installer manifest

<Resource
    Name="%accounting_user" 
    Description="Accounting"
    Permission="RW"/>
<Role 
    Name="%DB_USER"
    Description="Database user"
    Resources="MyResource:RW,MyResource1:RWU"
    RolesGranted= />
<User 
    Username="Clerk1"
    PasswordVar="clerk1pw"
    Roles="Dataentry"
    Fullname="Data Entry Clerk"
    Namespace=
    Routine=
    ExpirationDate=
    ChangePassword=
    Enabled=
    Comment=""/>