diff --git a/Resources/ChangeLog.html b/Resources/ChangeLog.html
index 5b92b9c..633f24f 100644
--- a/Resources/ChangeLog.html
+++ b/Resources/ChangeLog.html
@@ -1,6 +1,6 @@
WebDoorCreator - Egalware
- Version: 0.9.2305.2710
+ Version: 0.9.2305.2908
Release note:
-
diff --git a/Resources/VersNum.txt b/Resources/VersNum.txt
index 49d6894..6efddaa 100644
--- a/Resources/VersNum.txt
+++ b/Resources/VersNum.txt
@@ -1 +1 @@
-0.9.2305.2710
+0.9.2305.2908
diff --git a/Resources/manifest.xml b/Resources/manifest.xml
index d99c0f3..a720de5 100644
--- a/Resources/manifest.xml
+++ b/Resources/manifest.xml
@@ -1,6 +1,6 @@
-
- 0.9.2305.2710
+ 0.9.2305.2908
http://nexus.steamware.net/repository/SWS/WDC/stable/WDC.UI.zip
http://nexus.steamware.net/repository/SWS/WDC/stable/ChangeLog.html
false
diff --git a/WebDoorCreator.UI/Components/Gen/NavMenuHorizontal.razor b/WebDoorCreator.UI/Components/Gen/NavMenuHorizontal.razor
index 15cc1e5..d05cb93 100644
--- a/WebDoorCreator.UI/Components/Gen/NavMenuHorizontal.razor
+++ b/WebDoorCreator.UI/Components/Gen/NavMenuHorizontal.razor
@@ -73,7 +73,7 @@
{
@if (compToShow != null)
{
-
@compToShow.CompanyName
+
}
}
}
diff --git a/WebDoorCreator.UI/Components/Gen/NavMenuHorizontal.razor.cs b/WebDoorCreator.UI/Components/Gen/NavMenuHorizontal.razor.cs
index 5a24807..7a154a4 100644
--- a/WebDoorCreator.UI/Components/Gen/NavMenuHorizontal.razor.cs
+++ b/WebDoorCreator.UI/Components/Gen/NavMenuHorizontal.razor.cs
@@ -22,6 +22,7 @@ namespace WebDoorCreator.UI.Components.Gen
public EventCallback>> E_VocLemmas { get; set; }
public List listCompanies { get; set; } = new List();
+ protected List? userClaims { get; set; } = null;
public List listRecord { get; set; } = new List();
@@ -195,7 +196,7 @@ namespace WebDoorCreator.UI.Components.Gen
compToShow = listCompanies?.FirstOrDefault()!;
}
userCurrCompany = compToShow.CompanyId;
- }
+ }
protected override async Task OnInitializedAsync()
{
@@ -230,14 +231,15 @@ namespace WebDoorCreator.UI.Components.Gen
{
// reset preliminare
listRecord = new List();
- listCompanies = new List();
+ //listCompanies = new List();
if (!NavManager.Uri.Contains("UserAdmin"))
{
if (!string.IsNullOrEmpty(userId) && string.IsNullOrEmpty(userRole))
{
// FARE!!! rivedere con await WDCUsrServ.UserDataGetById(userId);
-
+ var user = await _userManager.FindByNameAsync(userId);
+#if false
var user = await _userManager.FindByNameAsync(userId);
var roleList = await _userManager.GetRolesAsync(user);
if (roleList != null)
@@ -278,10 +280,35 @@ namespace WebDoorCreator.UI.Components.Gen
}
compToShow = listCompanies?.FirstOrDefault()!;
}
- }
- fixSelCompany();
- userClaimsList = listRecord;
+ }
+ }
+#endif
+ var obj = await WDCUService.UserDataGetById(user.Id);
+ if (obj != null)
+ {
+ userClaims = obj.Claims.ToList();
+ if (userClaims != null)
+ {
+ if (obj.Roles.Contains("SuperAdmin"))
+ {
+ listCompanies = await WDCService.CompanyGetByKey(0);
+ }
+ else
+ {
+ foreach (var item in obj.Claims.ToList())
+ {
+ List rawComp = await WDCService.CompanyGetByKey(int.Parse(item.Value));
+ if (rawComp != null)
+ {
+ CompanyModel comp2Add = rawComp?.FirstOrDefault()!;
+ listCompanies.Add(comp2Add);
+ }
+ }
+ }
+ }
}
+ fixSelCompany();
+ userClaimsList = listRecord;
}
}
}
diff --git a/WebDoorCreator.UI/WebDoorCreator.UI.csproj b/WebDoorCreator.UI/WebDoorCreator.UI.csproj
index 3bdc440..fa9af50 100644
--- a/WebDoorCreator.UI/WebDoorCreator.UI.csproj
+++ b/WebDoorCreator.UI/WebDoorCreator.UI.csproj
@@ -3,7 +3,7 @@
net6.0
enable
- 0.9.2305.2710
+ 0.9.2305.2908
enable
aspnet-WebDoorCreator.UI-dfe95fed-1398-4144-bd43-8b3a765d6608