Get the Role of currently logged in user

SOLVE
jp-ikhokha
Member

Hi, just to confirm - at  present there is no way to get the Identity / Role of the currently logged in user either through an API call or through a  HUBL variable?

This is for an app built inside Hubspot, personalised functionality needs to be made available based on the logged in users role.

 

Thanks

 

JP

1 Accepted solution

Accepted Solutions
Willson
Solution
HubSpot Employee

Hi @jp-ikhokha 

 

I can confirm that we do not currently provide any means of surfacing this information via the API or through the use of HubL at this time. 

 

Thanks!

Product Expert | Customer Support
HubSpot

View solution in original post

5 Replies 5
Willson
Solution
HubSpot Employee

Hi @jp-ikhokha 

 

I can confirm that we do not currently provide any means of surfacing this information via the API or through the use of HubL at this time. 

 

Thanks!

Product Expert | Customer Support
HubSpot

View solution in original post

krillewestling
Member

Hi @Willson!

 

My team need a way to show certain information only to logged in "site administrators" on individual blog posts. (CMS Hub Professional)

I guess that the user role is not that important at this stage. A simple "is_logged_in" hubl variable or something like that would be enough.

Is there no way to accomplish this? I'm hoping that I've just missed that information in the documentation. 🙂

 

ckhicks
Participant

@krillewestling I have the same question...surely there's a filter for detecting a logged-in user, correct?

 

@Willson How else could you filter paid content to exclude bots/etc.? Like this, but in HubL: https://knowledge.hubspot.com/website-pages/require-member-registration-to-access-private-content

0 Upvotes
ckhicks
Participant

Actually...this is exactly what I'm looking for: https://legacydocs.hubspot.com/docs/methods/contacts/get_contact_by_utk

 

Any hopes of this being in a recent version of the API?

ckhicks
Participant

...more updates! We found this in the React <> HubSpot repo and it may do the trick: https://github.com/HubSpot/cms-event-registration/blob/master/src/event.functions/membership.js

 

Serverless functions to the rescue!

0 Upvotes