Permissions for lightboxes

Corvid does not provide permissions for lightboxes…anyone know if this can be coded. Want only certain members to have access to a lightbox.

You can check the user role or email, and only if it’s approved, open the lightbox:


wixUsers.currentUser.getEmail()
  .then( (email) => {
    if (isApproved(email)) {
       wixWindow.openLightbox("LightboxName")
    }
  } );