Search code examples
javamysqlapachetomcatjbpm

How to setup application roles in JBPM 6.2 deployed on tomcat


I have setup JBPM 6.2 on TOMCAT with H2 on tcp, for this I followed the steps from https://apurvasingh67.wordpress.com/2014/03/03/how-to-install-jbpm6-on-tomcat7-x/

As my application is using mysql to authenticate the users. I changed the tomcat Realm and used JDBC Realm to authenticate the users from mysql db, for this I followed the steps from https://tomcat.apache.org/tomcat-3.3-doc/JDBCRealm-howto.html

Now my application has some predifined roles like HR, Manager, TechLead, so I want to use those roles while logging into the jbpm-console and also through JBPM-rest Call.

Please help on how to add organization roles to jbpm roles. currently user/admin and other roles listed in workbench-policy.properties (apache-tomcat-7.0.55\webapps\jbpm-console\WEB-INF\classes) as working.


Solution

  • The approach I used is same as for Tomcat JDBC Realm with jbpm_users (username,password) and jbpm_roles(username, rolename) tables.

    For every organization roles (HR, Manager, TechLead) participating in the bpm process I inserted the username and rolename in jbpm_roles tables on user registration and update.

    Along with jbpm specific roles (admin, user, analyst, rest-all).

    This resolved the dynamic role mapping with registered users and also rest access to jbpm API's.