If you have a custom site role that contains an underscore, any user with this role will not be able to move to another role.
It seems to be because the group name of the site, created for this role, gets truncated.
For example, a user with the role name "test_customrole" in site "test-site", will be part a group called "site_test-site_test_customrole".
However, when trying to change the role of the user, the following message will appear in the logs :
Where it should actually be looking for an authority called GROUP_site_test-site_test_customrole
This was reproduced in 4.2.1 and 18.104.22.168
Steps to reproduce :
1. Put the attached sitePermissionDefinitions.xml file in webapps/alfresco/WEB-INF/classes/alfresco/model/ replace it with the existing one.
2. Start the server, login with admin and create a site "test-site"
3. Invite a user ( test-user) to the site and give it the test_customrole role
4. Login as the user and accept the invitation.
5. Log back as admin and go to the Site-Members page of the test-site
6. Change the role of the user from test_customrole to any other role
Actual result :
Error message is displayed : Failed to change role for user test-user
In the logs, the following is displayed
Expected result :
The role of the user is changed successfully.