Skip to main content
HASP apps receive the current user’s role from sdk.getBootstrap(). Use it to conditionally show or hide editing controls so viewers see a read-only interface while editors and admins get the full UI.

Getting the Role

Always call getBootstrap() before rendering the UI:

Hiding Controls from Viewers

Alternatively, use CSS classes:

Inline Edit Controls

Show edit and delete buttons only for editors/admins:

Proactive Check Before Write

Even if the UI hides write controls for viewers, always handle AccessDenied errors gracefully in case the role changes mid-session:

Bootstrap Data

getBootstrap() returns more than just the role:
You can use bootstrap.user to personalize the UI or pre-fill the current user’s email in a form.