How do I show content only to members with a permission?

Read the membership permissions a signed-in customer holds and use them to show or hide parts of your website.

Add the permission to the membership plan first. In the plan's Permissions section, create the permission (for example VIP Lounge) or tick an existing one, then save the plan.

On your website, call hasPermission('VIP Lounge') to check one permission, or getPermissions() for the full list. Both work in the DOM Package 1.18.0 or newer and the Hosted Package script 1.5.0 or newer. The customer must be signed in; hasPermission() resolves false for a visitor who is not.

A customer holds a plan's permissions while the membership is in force, including a membership held by their company. A membership that has ended, has not started yet, or is unpaid past its grace period grants none. Permission names match ignoring case and surrounding spaces.

Showing or hiding content in the browser does not protect it. For content that must stay private, check the permission on your server before returning it.

See DOM membership permissions, Hosted membership permissions and List Memberships.