Adding roles "rest-all" and "kie-server" to Workbench issues

1,575 views
Skip to first unread message

Sasha S

unread,
Jul 18, 2016, 11:04:20 AM7/18/16
to Drools Setup
Hi,
I'm using drools-workbench-showcase:6.4.0.Final and kie-server-showcase:6.4.0.Final in conjunction as Docker images. Since I'm not using directly the workbench UI, I clone the Git repository, create drl assets and push it back to Git.
Till now all right, but I have problems with the next step. I want to build the project and deploy it to Maven repository and so have to use Workbench REST Api. 

I have tried to access the rest API by curl:

curl -i 'http://admin:admin@localhost:8080/drools-wb/rest/repositories'

but it shows restricted access (HTTP/1.1 403 Forbidden).

According to some related posts, I need "rest-all" role assigned to my admin user and, probably, "kie-server" role too to be able to connect also to REST Api of Kie server.

The existent roles, according the documentation are:
USER PASSWORD ROLE ************************************************* admin admin admin,analyst,kiemgmt krisv krisv admin,analyst john john analyst,Accounting,PM mary mary analyst,HR sales-rep sales-rep analyst,sales katy katy analyst,HR jack jack analyst,IT 
salaboy salaboy admin,analyst,IT,HR,Accounting
but really, there are only 4 predefined roles: admin,analyst,kiemgmt,plannermgmt, the rest are groups.
I haven't found way to add an another role using UI.

First of all, I tried to edit manually  /opt/jboss/wildfly/standalone/configuration/drools-roles.properties file and added the required roles to admin user like this:
admin=admin,analyst,kiemgmt,rest-all,kie-server

this way "rest-all","kie-server" were added to admin user, but as groups, NOT AS ROLES.

Second, rolled back the changes made by first way and tried to use kie-config-cli-6.4.0.Final-dist. When I run ./kie-config-cli.sh the result is following:

>>Please enter command (type help to see available commands):
help
Result:
****************** KIE CLI Help ************************
********************************************************
Available commands:
         exit - publishes any work, cleans up temporary directories and quits this command line tool
         discard - won't publishes local changes, cleans up temporary directories and quits this command line tool
         help - prints this message
         list-repo - list available repositories
         list-org-units - list available organizational units
         list-deployment - list available deployments
         create-org-unit - creates new organizational unit
         remove-org-unit - remove existing organizational unit
         add-deployment - add new deployment unit
         remove-deployment - remove existing deployment
         create-repo - creates new git repository
         remove-repo - remove existing repository from config only
         add-repo-org-unit - add repository to the organizational unit
         remove-repo-org-unit - remove repository from the organizational unit
         add-group-repo - add group(s) to repository
         remove-group-repo - remove group(s) from repository
         add-group-org-unit - add group(s) to organizational unit
         remove-group-org-unit - remove group(s) from organizational unit
         add-group-project - add group(s) to project
         remove-group-project - remove group(s) from project
         push-changes - pushes changes to upstream repository (only online mode)
         fetch-changes - fetches changes from upstream repository (only online mode)     list-project-details - list detailed information about project inside repository
>>>>>>>>>>>>>>>>>>>>>>>>>>>
>>Please enter command (type help to see available commands):
add-role-org-unit
No command found for 'add-role-org-unit'
exit

As you can see, no "add-role..." present here.

Do I something wrong? Can you help me, please?

Jeff Jensen

unread,
Jul 18, 2016, 12:06:35 PM7/18/16
to Drools Setup
Since you are using Wildfly, use Wildfly's "add-user" command (located in its bin directory) to add a user and roles.  It automatically updates the correct files.  My guess is you missed something in manually adding.

For example:
add-user -a -u kieserver -p kieserver -ro admin,kie-server,rest-all


--
You received this message because you are subscribed to the Google Groups "Drools Setup" group.
To unsubscribe from this group and stop receiving emails from it, send an email to drools-setup...@googlegroups.com.
To post to this group, send email to drools...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/drools-setup/716105e1-9295-4321-8808-f37f35fe041c%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Sasha S

unread,
Jul 19, 2016, 4:14:14 AM7/19/16
to Drools Setup
Thanks for the answer. I have tried this:
[jboss@6d0a4ccaee22 bin]$ ./add-user.sh -a -u kieserver -p kieserver -ro admin>
Added user 'kieserver' to file '/opt/jboss/wildfly/standalone/configuration/application-users.properties'
Added user 'kieserver' to file '/opt/jboss/wildfly/domain/configuration/application-users.properties'
Added user 'kieserver' with groups admin,kie-server,rest-all to file '/opt/jboss/wildfly/standalone/configuration/application-roles.properties'
Added user 'kieserver' with groups admin,kie-server,rest-all to file '/opt/jboss/wildfly/domain/configuration/application-roles.properties'

Really, the user was not added to Workbench. At least it not present in users list in UI.

понедельник, 18 июля 2016 г., 19:06:35 UTC+3 пользователь Jeff Jensen написал:

Zoran Hristov

unread,
Sep 12, 2016, 6:55:42 AM9/12/16
to Drools Setup
I found this question still valid, especially with the cloud distribution for Tomcat. One can not add roles, and in file adding for Tomcat results in group add for user.
In UI only available roles are Admin and Analyst
KIE_6.4_roles.PNG

caicongyang

unread,
Jun 19, 2017, 7:21:57 AM6/19/17
to Drools Setup
 I ran into the same problem ?any one others  have the answer?
Reply all
Reply to author
Forward
0 new messages