Skip to content

CodeCoupler API Auth Helper

The following function are available. These are just helpers. For more advanced editing you should use the repositories directly. Read carefully what the functions will do:

AddUserRolePermission(Application, Username, Password, Role, Permission)

This function will add a user with the specified password if the user do not exist. It will not change the password if the user already exists.

Furthermore the specified role and permission will be added if they do not exists. And finally the permission will be added to the role. Therefore the function have to be used carefully, because it modifies existing roles!

Usefull for oneliner in the bootstrap script to add default users.

UpdateOrAddUserAndPermissions(Application, Username, Password, Permissions[], externalId)

This function will update an existing users password, enable the user and assign the given permissions. If the user do not exist he will be added.

Already assigned permissions will be set as allowed. Already assigned permisssions not listed in Permissions[] will be removed!

Usefull for quickly synchronizing users from other authentication sources which do not have to much complexity (like roles and role-permission-relations).

Back to top