Thursday, August 27, 2015

Importing security roles & users via the TDTT may cause some roles to not appear under the users

If you ran my previous blog entry on exporting and importing users + role assignments via the TDTT (Test Data Transfer Tool) then in some cases where a custom role was created and assigned then the assignment may not show up in the UI. This is because the data is transferred but the root handle id has changed/is different from environment to environment. So we need to update the security role assignment with the correct root handle.

In order to fix this issue we need to do the following



On the model db of the src and of the target

  SELECT [RootHandle],[ElementHandle],[Name]
  FROM [dbo].[ModelElement]
  where ElementType = '133'
  order by name


(Element Type = 133 is telling us to display roles only)



Then we need to compare the root handle ids to one another for each of the role names. If they do not match then the following needs to happen on the target db (data database)


update [ax_target_db].[dbo].[SECURITYUSERROLE]
set SECURITYROLE ='roothandlefromtargetdb'
where SECURITYROLE = 'roothandlefromsrcdb'


After running this then your root handles for roles should match up now.

No comments:

Post a Comment