MH: Sichtbarkeitsbedingung für Teams in CustomerNavigationView

This commit is contained in:
Marcel Hirschle
2022-08-04 08:18:13 +02:00
parent a05ab11de5
commit 06b3ad850f
2 changed files with 19 additions and 2 deletions

View File

@@ -150,7 +150,7 @@ namespace DiakonieLandshut
}
else if (maLastName.Contains("Hoss") || maLastName.Contains("Hoß"))
{
xrBox.Image = xrPictureBox2.Image;
xrBox.Image = picMasterHoß.Image;
}
}
else

View File

@@ -86,6 +86,23 @@ namespace BeWo.Service.Plugins
teamOids = CreateTeamOidDict(currentEmployeeOid.Value);
}
UserDC user;
if (LoggedInUserOperationContextExt.Current != null && LoggedInUserOperationContextExt.Current.User != null)
{
user = MapperFactory.UserDC_User.MapToNewDC(LoggedInUserOperationContextExt.Current.User);
}
else
{
user = MapperFactory.UserDC_User.MapToNewDC(SessionFacade.LoggedInUser);
}
var hasRight1 = user.HasRight(UserRightType.TeamView_ViewAll);
var hasRight2 = user.HasRight(UserRightType.CustomerView_View);
if (teamOids.Count == 0 && hasRight1 && hasRight2)
{
foreach (var t in teams)
teamOids.Add(t.TeamOid, t.TeamOid);
}
foreach (Customer customer in customers)
{
if (!cProcessed.ContainsKey(customer.Oid.Value))
@@ -93,7 +110,7 @@ namespace BeWo.Service.Plugins
CompactCustomerDC dc = CreateCompactCustomerDCWithEmployeeRelation(customer, fetchReferenceNumbers, true, currentEmployeeOid, teamOids);
// Alle zugehörigen Teamnamen setzen
if (dc.RelatedTeamOids != null)
if (dc.RelatedTeamOids != null) // Hier muss entweder eine neue Bedingung festgelegt werden oder es muss ganz weg, sonst wird man keine Teamzuordnungen sehen, wenn man selbst in keinem Team ist
{
foreach (var oid in dc.RelatedTeamOids)
{