CMS Development

Sk05
Participant

Dynamic menu based on API response

SOLVE

Hi Everyone,


We have the Login feature and SITEs are built in HubSpot, All the user's information and other information is stored in our client's existing server DB.

Our Problem is that After login we have to show the menus based on the API response of the user's permission

For Example,
Users have Post access they can see POST Page in the menu.
Users have News access they can see NEWS Page in the menu.
Users have Article access they can see the ARTICLE Page in the menu. like that

Whoever does not have permission to view POST, NEWS, ARTICLE we should not show this in the menu list.

So, please share your ideas. Thanks


0 Upvotes
1 Accepted solution
Teun
Solution
Recognized Expert | Diamond Partner
Recognized Expert | Diamond Partner

Dynamic menu based on API response

SOLVE

Hi @Sk05,

I would personally store this information in a cookie or something similar. DO NOT store any personal information, only the permissions that a user has, and that way, you can use HubL to access that information with `request.cookies`.

If the permission functionality is more than just showing different menu items, and you will allow users to manipulate data from the HS website, you definitely need a different approach because of security.



Learn more about HubSpot by following me on LinkedIn or YouTube

Did my answer solve your issue? Help the community by marking it as the solution.


View solution in original post

2 Replies 2
Teun
Solution
Recognized Expert | Diamond Partner
Recognized Expert | Diamond Partner

Dynamic menu based on API response

SOLVE

Hi @Sk05,

I would personally store this information in a cookie or something similar. DO NOT store any personal information, only the permissions that a user has, and that way, you can use HubL to access that information with `request.cookies`.

If the permission functionality is more than just showing different menu items, and you will allow users to manipulate data from the HS website, you definitely need a different approach because of security.



Learn more about HubSpot by following me on LinkedIn or YouTube

Did my answer solve your issue? Help the community by marking it as the solution.


Sk05
Participant

Dynamic menu based on API response

SOLVE

Hi @Teun Thanks for the reply. Yes that's work