I have the following table data:
SELECT * from Autenticacao_Permissoes;
PermissionId PermissionName RoleId
------------ -------------- ---------
1 Pages.Clientes.Editar.Test 3
2 Pages.Sinistros.Editar 3
3 Pages.Hack.Ver.Editar.Comer.Maca 3
4 Pages.Sinistros.VerFolder3 3
5 Pages.Hack.Ver NULL
There is no limit to the permissions' depth and I would like to have a temporary table with the following format:
SiteMapId Title RoleId ParentId
--------- ------------------------ ------ --------
1 Pages NULL NULL
2 Clientes NULL 1
3 Sinistros NULL 1
4 Hack NULL 1
5 Editar NULL 2
6 Test 3 5
7 Editar 3 3
...
The idea is to use it according to the ASP.NET sitemap data structure.