Page 1 of 1

Changing default roles in OpenKM 6.2.2

PostPosted:Tue Feb 05, 2013 10:58 am
by jho_ed
Hi,

I wonder how to change the configuration from using the roles ROLE_ADMIN and ROLE_USER to something like OPENKM_ADMIN and OPENKM_USER. When looking at http://wiki.openkm.com/index.php/Applic ... ction_role the documentation seems to be JBoss specific. Is there any how-to for OpenKM 6.2.2?

Thanks!

Re: Changing default roles in OpenKM 6.2.2

PostPosted:Thu Feb 07, 2013 6:33 pm
by jllort
Why do you need to change it. Which is the problem you got with this role names ? you're connecting to some ldap or similar because is not good idea do this kind of change at same time, better step by step.

You should change applicationContext.xml ( into war file ) and obviously in Administration -> configuration parameters.

If you look in this forum for ROLE_ADMIN you'll find other post about that.

Re: Changing default roles in OpenKM 6.2.2

PostPosted:Fri Feb 08, 2013 6:08 am
by jho_ed
jllort wrote:Why do you need to change it. Which is the problem you got with this role names ? you're connecting to some ldap or similar because is not good idea do this kind of change at same time, better step by step.

You should change applicationContext.xml ( into war file ) and obviously in Administration -> configuration parameters.

If you look in this forum for ROLE_ADMIN you'll find other post about that.
The reason is that we are running other applications than OpenKM as well and also having a number of other roles/groups in our LDAP. Having generic names like ROLE_USER and ROLE_ADMIN is very confusing. For which application are you ADMIN/USER for? If we only were using OpenKM and having no other roles/groups in our LDAP there would not be a problem.

I have looked at the other posts and there are a number of people who would like to know how to change the role names, but there does not seem to be a straight forward answer/how to to that. Hence my raised question. To me the number of questions indicate a need for a how to for this task. At the moment I do not even know where to start and build such a how-to myself.

Re: Changing default roles in OpenKM 6.2.2

PostPosted:Sat Feb 09, 2013 10:12 am
by jllort
I suggest doing in two steps. First integrate with ldap with default roles name ( simply create these and after you will rename ok ?) and ensure users, roles etc... the configuration is right.

Then you should do some changes:
1- Administration -> configuration parameters should change:
default.admin.role
default.user.role
2- Stop OpenKM
3- Edit war file and change /WEB-INF/applicationContext.xml the entries with ROLE_ADMIN to your new role name

Re: Changing default roles in OpenKM 6.2.2

PostPosted:Mon Feb 11, 2013 10:34 am
by pavila

Re: Changing default roles in OpenKM 6.2.2

PostPosted:Sat Apr 11, 2015 1:19 pm
by mirec.z@gmail.com
Did this somehow change since 2013? I'm using OpenKM 6.3.0
Logged in as admin, changing "default.admin.role" to dms-admin causes "Only admin users allowed" error...

Re: Changing default roles in OpenKM 6.2.2

PostPosted:Tue Apr 14, 2015 8:24 pm
by jllort
Did you also change the applicationContext.xml configuration file ?

Take on mind that this kind of changes cannot be done on-the-fly. You have to stop the application, make the change and start the application again.

Re: Changing default roles in OpenKM 6.2.2

PostPosted:Thu Jul 30, 2015 12:21 am
by richbcph
Followed the wiki exactly and now I get:

HTTP Status 404 - /OpenKM
type Status report
message /OpenKM
description The requested resource is not available.

If I revert back the changes to the XML and restore my role_user/admin everything comes back up. I wonder if the group names cannot accept spaces. My group for users would be AAGRP - Users and AAGRP - OUadmins

Does it not accept spaces in name or is there something else I should be editing beside the xml? I copied the new role names exactly as they currently are (case sensitive).

Thanks
Rich

PS on 6.3 if that makes a difference

Re: Changing default roles in OpenKM 6.2.2

PostPosted:Thu Jul 30, 2015 7:05 am
by pavila
Please, stop Tomcat, clean $TOMCAT_HOME/logs and start Tomcat again. Once it's up, please post the catalina.log file, but zipped.

Re: Changing default roles in OpenKM 6.2.2

PostPosted:Thu Jul 30, 2015 2:48 pm
by richbcph
Logs have been attached. Domain info has been replaced.

Re: Changing default roles in OpenKM 6.2.2

PostPosted:Thu Jul 30, 2015 2:56 pm
by richbcph
Also what is very odd to me is when I make the change in the xml file and restart tomcat the website loads up and logs in directly as me without me entering a password! I thought it was a fluke the first time it happened but just after the change and tomcat restart it assumed me and went in without any password.

Heres what I did.

Make change to role names.
make changes to xml.
Stop tomcat.
Restart tomcat.
Refresh OpenKM page
Page should get 404. *Do not close page
Change xml doc back to ROLE_ADMIN
Restart tomcat
Refresh webpage. You should login as last user without entering password.

It only seems to do this once though.

Anyone else confirm this?

Re: Changing default roles in OpenKM 6.2.2

PostPosted:Fri Jul 31, 2015 9:40 am
by pavila
I haven't realize until now but, are you really using OpenKM 6.2.2 ? This is a Professional version and it's very, very old.

Re: Changing default roles in OpenKM 6.2.2

PostPosted:Fri Jul 31, 2015 3:20 pm
by richbcph
6.3 is what I'm using. Just downloaded it a few days ago. Fresh install on new server.

Re: Changing default roles in OpenKM 6.2.2

PostPosted:Fri Jul 31, 2015 4:38 pm
by pavila
O, but the subject is about OpenKM 6.2.2.

Anyway try a fresh 6.3.1 install, because this change was tested in a fresh installation. You can download from http://integration.openkm.com/6.3/

Regards.

Re: Changing default roles in OpenKM 6.2.2

PostPosted:Mon Aug 03, 2015 2:36 pm
by richbcph
This was a fresh build :) (New server install and download). I will start a new thread. Thanks