Questions Tagged With rolehttps://answers.axonivy.com/tags/role/?type=rss&user=trungdvquestions tagged <span class="tag">role</span>enThu, 19 Apr 2018 07:03:43 -0400Old userrole mapping still remain after renaming rolehttps://answers.axonivy.com/questions/3224/old-userrole-mapping-still-remain-after-renaming-role<p>Hi ivyteam</p> <p>In my project, i have the role name <code>Front RM</code> and i assign some users for it. Then some version later i rename that role to <code>FrontRM</code> (remove space). That mean all users will be mapped to <code>FrontRM</code></p> <p>Now i use <code>ivy.session.getSessionUser().getRoles()</code> but it always say that user has two roles <code>Front RM</code> and <code>FrontRM</code>.</p> <p>I've investigated then see that there still remain old mapping between user and old role. That's mean when i rename a role, ivy actually add a new role with new name and keep old one with mapping. I explained in this picture: <img alt="alt text" src="https://answers.axonivy.com/upfiles/Untitled_ksSIFXV.png"></p> <p>Some questions:</p> <ol> <li>Why ivy still keep old role + old mapping? it's because of multiple PMVs? But in case there is only one PMVs so could ivy remove unnecessary role completely?</li> <li>Does api <code>ivy.session.getSessionUser().getRoles()</code> return correct roles as it display on Admin Tool? If not can i base on any flag to remove that <code>inactive</code> role?</li> </ol> <p>Thanks</p>trungdvThu, 19 Apr 2018 07:03:43 -0400https://answers.axonivy.com/questions/3224/old-userrole-mapping-still-remain-after-renaming-rolerole