Base solution for your next web application
Open Closed

Login and getting user in angularjs #264


User avatar
0
hans abelshausen created

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)
  • User Avatar
    0
    hikalkan created
    Support Team

    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.

  • User Avatar
    0
    hans abelshausen created

    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

  • User Avatar
    0
    hikalkan created
    Support Team

    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.