How to get roles associated with a user via API

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • rmorgan
    Member
    • Feb 2019
    • 50

    #1

    How to get roles associated with a user via API

    I am trying to figure out how to get all of the roles associated with the logged in user via the API. I can get the default team and other teams from when I log in, but I am clueless of how to get the roles associated with the user. I can query users and get the user list but that doesnt indicate roles. I can query roles and get the list of roles but that doesnt help as it doesnt show users.

    So what / how should I query to get the roles associated with a user?

    Help!
  • yuri
    Member
    • Mar 2014
    • 9117

    #2
    It's not possible other that for an admin user. You can create a custom API route though.

    The purpose of Roles is permission management, they should not be used to mark the user's role in the company or things like that.
    If you find EspoCRM good, we would greatly appreciate if you could give the project a star on GitHub. We believe our work truly deserves more recognition. Thanks.

    Comment

    • rmorgan
      Member
      • Feb 2019
      • 50

      #3
      ok. My goal was to use a 'Management' role to allow the associated people to see all of the users data who are part of the same team (i.e they get permission to see all of the data for their staff).

      Comment

      • yuri
        Member
        • Mar 2014
        • 9117

        #4
        You can use a custom field for that. Or the Teams field.
        If you find EspoCRM good, we would greatly appreciate if you could give the project a star on GitHub. We believe our work truly deserves more recognition. Thanks.

        Comment

        Working...