automatically change role after login

Document created by Michael Mueller Employee on Jun 19, 2017
Version 1Show Document
  • View in full screen mode

Based on the this idea I'd like to share the following


Because I had a similar question from another customer recently, I created the simple attached htmpl file.

At least it provides the ability to specify a role id and will do an automatic role change after login.

Just copy the file to your

  • site/mods/www/htmpl/web/analyst
  • site/mods/www/htmpl/web/employee
  • site/mods/www/htmpl/web/customer


and call it by



How does it work:

After logging into SDM the user gets his last role (or his default role) automatically assigned by the system, and therefor gets presented by the appropriate user interface.

By specifying the given htmpl file as the initial file to show, the htmpl file gets loaded by the browser, which initiates an automatic role change to the given role_id.

tested only in 17.0, but I assume it will work in previous versions as well.


Of course there are some things missing.

  • The file does not check if the logged in user is allowed to set and get the given role.
    • This is the general issue/question with the idea above.
    • nevertheless, this could be easily implemented by some javascript and pdm_list stuff.
  • the file does not handle the ability to specify a given initial operation like OP=SHOW_DETAIL+... , etc., yet.

 But I'm quite sure you'll find a way to do the rest


Use the file as it is, adopt it to your needs and share it back to the community, if you've made usefull enhancements.

Hope this helps a bit.



2 people found this helpful