0
omital created
I have a Custom session called LIMSSession like this
public class LIMSSession : ITransientDependency
{
public int? SubsystemId
{
get
{
var claimsPrincipal = Thread.CurrentPrincipal as ClaimsPrincipal;
if (claimsPrincipal == null)
{
return null;
}
var emailClaim = claimsPrincipal.Claims.FirstOrDefault(c => c.Type == "SubsystemId");
if (emailClaim == null || string.IsNullOrEmpty(emailClaim.Value))
{
return null;
}
return Convert.ToInt32(emailClaim.Value);
}
}
}
SubsystemId initialized after user select current subsystem (after login page) How I can inject LIMSSession to AbpNavigationProvider?
2 Answer(s)
-
0
I setup navigation provider constructor like this
public LIMSNavigationProvider(LIMSSession LIMSSession) { _LIMSSession = LIMSSession; }
but SybsystemId always return null?!
-
0
Hi,
Navigation provider only works once the application starts (where there is no session actually). So, you can not create your menus based on the current user. If you want to do that, you can do it just before rendering it in the template.