Hi! I logged in and returned to destination page. Is there a way to get the logged in user in my javascript code and hide some buttons if user is not in role to see this buttons?
3 Answer(s)
-
0
Hi,
Surely, you can check if the user has a permission. See client side section in <a class="postlink" href="http://www.aspnetboilerplate.com/Pages/Documents/Authorization">http://www.aspnetboilerplate.com/Pages/ ... horization</a>
Also, you can read module-zero documentations in <a class="postlink" href="http://www.aspnetboilerplate.com/Pages/Documents">http://www.aspnetboilerplate.com/Pages/Documents</a> to learn how to grant permissions.
-
0
Sorry, I think I misspelled my question. I only want to Show the username of the logged in user at the top of my application. And my question is is there an abp.user or something else so that I get the Name of the logged in user. In abp.session there is the id of the user and I can get the username from db, but I thought the username is saved somewhere after logging in
-
0
OK, then there is no built-in way of getting current user name. You've UserId in the session, so you can implement it easily. Thanks.