• Question about new Roles

  • OpenKM has many interesting features, but requires some configuration process to show its full potential.
OpenKM has many interesting features, but requires some configuration process to show its full potential.
Forum rules: Please, before asking something see the documentation wiki or use the search feature of the forum. And remember we don't have a crystal ball or mental readers, so if you post about an issue tell us which OpenKM are you using and also the browser and operating system version. For more info read How to Report Bugs Effectively.
 #19147  by luke
 
Hi

I have a question about new roles. I imported repository from OpenKM 5.1.11 to 6.2.1
I executed the command UPDATE OKM_NODE_ROLE_PERMISSION SET NRP_ROLE=concat('ROLE_', NRP_ROLE) WHERE NRP_ROLE NOT LIKE 'ROLE_%'; - same rows affected.
Now I have ROLE_ADMIN, Role_USER, Role_UserRole, Role_AdminRole
Are all roles necessary or I may delete the old ones ? Now my users have Role_UserRole and admins Role_AdminRole.
 #19173  by jllort
 
You can delete older roles.
Update user roles to new format.
Ensure in your OKM_NODE_ROLE_PERMISSION and OKM_NODE_USER_PERMISSION talbles there're not older names, otherside change it.
 #23266  by bill_mcgonigle
 
luke wrote:I executed the command UPDATE OKM_NODE_ROLE_PERMISSION SET NRP_ROLE=concat('ROLE_', NRP_ROLE) WHERE NRP_ROLE NOT LIKE 'ROLE_%'; - same rows affected.
Now I have ROLE_ADMIN, Role_USER, Role_UserRole, Role_AdminRole
It appears to me that the documentation should tell upgraders to also issue:
Code: Select all
UPDATE OKM_USER_ROLE SET UR_ROLE = 'ROLE_USER' WHERE UR_ROLE = 'ROLE_UserRole';
UPDATE OKM_USER_ROLE SET UR_ROLE = 'ROLE_ADMIN' WHERE UR_ROLE = 'ROLE_AdminRole' AND UR_USER != 'okmAdmin';
during the upgrade. At least, that's what it took to get the system I look after to allow users and admins to log in again.
 #23295  by jllort
 
I suggest ( the each role name started with ROLE_ is not mandatory, althought spring considers good practice, that's why in migration appears with ROLE_ in front, but in case UserRole and AdminRole should be transformed to ROLE_USER and ROLE_ADMIN ).
Code: Select all
UPDATE OKM_USER_ROLE SET UR_ROLE = 'ROLE_USER' WHERE UR_ROLE = 'UserRole';
UPDATE OKM_USER_ROLE SET UR_ROLE = 'ROLE_ADMIN' WHERE UR_ROLE = 'AdminRole' AND UR_USER != 'okmAdmin';

About Us

OpenKM is part of the management software. A management software is a program that facilitates the accomplishment of administrative tasks. OpenKM is a document management system that allows you to manage business content and workflow in a more efficient way. Document managers guarantee data protection by establishing information security for business content.