How locks work
The three building blocks behind every lock in Sami B2B Lock, Password Protect — content, access rules, and behavior.
Every lock you create in Sami B2B Lock, Password Protect is made of the same three pieces. Once these three concepts click, every other page in these docs is just a variation on one of them.
1. Content to lock
This is what you're protecting: your whole website, specific products or variants, collections, pages, blogs and articles, a specific URL, or checkout. A lock always protects exactly one content type, and you can carve out exceptions with an exclude list (specific URLs or products that stay open even though the rest of that content type is locked).
See Locks overview for the full list of content types and how to combine them across multiple locks.
2. Access rules
This is who or what must be true about the visitor before the content unlocks. Access rules check things like whether the visitor is logged in, has a specific customer tag, knows a passcode, is browsing from a particular country, or has a certain product in their cart.
Rules are grouped into access keys:
Rules inside the same access key are combined with AND — the visitor must satisfy every rule in that key. Use this to build something like "must be logged in AND tagged wholesale."
Most rules also have an If / Unless setting: If means the rule is satisfied when the visitor matches the condition, and Unless inverts that — satisfied when the visitor does not match. This doesn't apply to the action-based rules (Passcode, Secret link, Subscribe to unlock, Confirmation prompt, Custom liquid), since those work through their own verification step rather than a simple yes/no match.
See Access rules overview for the full catalogue of rules, and Combining rules for more on how multiple conditions are evaluated.
3. Lock behavior
This is what actually happens to a visitor who doesn't pass your access rules. Depending on the content type, that can mean:
The price and/or Add to cart button are hidden, with a message or styled button shown in their place.
A lock screen or message appears asking the visitor to sign in, enter a passcode, subscribe, confirm a statement, or otherwise verify themselves.
The visitor is redirected to a different page or URL.
The item is hidden from storefront menus and/or from on-site search and sitemaps, so it's not just blocked but not discoverable either.
You can combine several behaviors on the same lock — for example, hiding a product's price and Add to cart button while also removing it from your navigation menu.
See Lock behavior overview for the full list of behaviors and how they interact.
Related docs
Last updated
Was this helpful?