Page 1 of 1

Question about new Roles

PostPosted:Mon Nov 05, 2012 7:57 pm
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.

Re: Question about new Roles

PostPosted:Tue Nov 06, 2012 9:32 pm
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.

Re: Question about new Roles

PostPosted:Fri May 31, 2013 2:23 am
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.

Re: Question about new Roles

PostPosted:Sun Jun 02, 2013 6:09 pm
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';