Why AbpSession.UserId is null in my Application layer? I disabled multytenancy!
6 Answer(s)
-
0
this code
Thread.CurrentPrincipal.Identity.GetUserId()
Returns null and
Thread.CurrentPrincipal.Identity.IsAuthenticated
is False !
-
0
It will be null if user did not login or IAbpSession is not implemented (if you're using module-zero, then it's implemented). If Thread.CurrentPrincipal.Identity.IsAuthenticated is false, that shows user not logged in.
-
0
Thank You, but User is logged in and U use module-zero
I create it from Templates
-
0
I found the problem! The problem is that I want to get Current user Information in NavigationProvider to generate menu items according to user Roles ! and when NavigationProvider Creates menu No user is Logged in.
So my question changed to this:
HOW CAN I GENERATE MENU ACCORDING TO USER ROLES?
-
0
Hi,
You can not get UserId in NavigationProvider since it's executed once on application startup, independent from users.
You can use permissions (instead of roles) to authorize menu items. See Navigation document: <a class="postlink" href="http://www.aspnetboilerplate.com/Pages/Documents/Navigation">http://www.aspnetboilerplate.com/Pages/ ... Navigation</a>
-
0
<cite>hikalkan: </cite> Hi,
You can not get UserId in NavigationProvider since it's executed once on application startup, independent from users.
You can use permissions (instead of roles) to authorize menu items. See Navigation document: <a class="postlink" href="http://www.aspnetboilerplate.com/Pages/Documents/Navigation">http://www.aspnetboilerplate.com/Pages/ ... Navigation</a>
Thank You So Much ! I didn't notice that !
You Are So Fantastic...