Permissions and access
Every permission key the MLM & Affiliate addon uses, which screen and which endpoint each one guards, the keys that deliberately do not exist, and the KYC features that gate members.
Access to the affiliate admin is decided by the platform's normal role and permission system — see Roles and permissions for how keys, roles and the Super Admin bypass work in general. This page lists what this addon adds.
There are 15 permission keys, all prefixed affiliate. Note that the store
slug is mlm and the extension is named mlm, but not one permission key
contains that word.
The keys
Four access.* keys gate admin pages. Eleven view/create/edit/delete.* keys
gate the API.
| Key | Guards |
|---|---|
access.affiliate |
The admin dashboard page and its data endpoint |
access.affiliate.referral |
The Referrals page, the single-referral detail page and the Applications page |
access.affiliate.reward |
The Rewards page |
access.affiliate.settings |
The Settings page |
view.affiliate.referral |
List referrals, read one, read a tree node; list affiliate applications |
create.affiliate.referral |
Create a referral by hand |
edit.affiliate.referral |
Update a referral, approve or reject it; add an affiliate, approve, reject, revoke or reconsider an application. Also the permission whose holders are notified of a new application |
delete.affiliate.referral |
Delete one or many referrals; delete one or many affiliate standings |
view.affiliate.condition |
List conditions, read one |
create.affiliate.condition |
Create a condition |
edit.affiliate.condition |
Update a condition, enable or disable it, delete one that never paid |
view.affiliate.reward |
List rewards, read one |
create.affiliate.reward |
Create a reward by hand |
edit.affiliate.reward |
Update a reward, mark it claimed |
delete.affiliate.reward |
Delete one or many rewards |
Keys that deliberately do not exist
A key of their own for applications. Affiliate applications and approvals ride
on the referral keys: whoever works the referral approval queue works the
Applications screen too, and the list of keys does not grow. Grant edit.affiliate.referral
carefully, because it now also decides who is an affiliate and so who earns the
Affiliate Program's commissions.
A delete. key for conditions. Deleting a condition needs
edit.affiliate.condition. A condition that has paid cannot be deleted at all,
by anyone including a Super Admin, because its rewards would go with it; you
switch it off instead. One that is off and has never paid can be deleted.
An access. key for the Conditions page. It carries no page-level
permission file, unlike the other three admin screens. It is reachable by anyone
who can open the affiliate admin at all, and the protection is on the API
underneath it — the list will not load without view.affiliate.condition, and
nothing can be saved without create or edit.
edit.affiliate.condition is the most expensive grant in this addon. It sets
commission rates, and it is the switch that turns a competing condition on. A
role with it can double what every transaction on your platform costs you, from
a screen that does not gate itself.
Treat it the way you would treat a fee-setting permission, not the way you would treat a content permission.
A minimal read-only role
For someone who needs to see the programme but not change it:
access.affiliateaccess.affiliate.referralaccess.affiliate.rewardview.affiliate.referralview.affiliate.rewardview.affiliate.condition
They will see the dashboard, the referral list, the reward ledger and the rates, and every write action will fail.
A support role that can work the approval queue
Add edit.affiliate.referral to the read-only set. That allows approving and
rejecting, which is the whole of the daily queue, without allowing rate changes,
manual rewards or deletions.
What members need
- Edit the level that should carry token-sale access
No permission. Every member-facing screen under /affiliate is gated on being
signed in, not on a permission. Whether a member counts as an affiliate is a
row on the Applications table, not a flag on their role: on a site that does not
require applications every signed-in member counts, with no row; on one that does,
only a member whose application is approved does. Everybody else is in the
Referral Program, which needs no opt-in either — every registered user has a
referral link and can earn its one-time rewards.
The two things that do gate members are KYC features.
| Feature key | Label in the KYC level builder | Where it is enforced |
|---|---|---|
affiliate_mlm |
Affiliate Program | The member dashboard, in the browser only |
withdraw_affiliate |
Affiliate Payouts | The claim endpoint, server-side |
affiliate_mlm hides the member's dashboard behind a verification notice. It
does not stop referrals being recorded and it does not stop commissions
accruing, because it is a frontend check.
withdraw_affiliate is checked by the server before a reward is claimed and is
the one that actually holds money back. If your compliance position is "no
payouts before verification", that is the feature to require.
Both are configured per KYC level under Admin → CRM → KYC, on the level builder's feature list.
What controls the menus
Two independent conditions, both of which must be true.
The admin entry (Business Tools → Affiliate Program) requires the mlm
extension to be enabled and the viewer to hold access.affiliate. A Super
Admin on an install with the extension switched off still sees nothing.
The member entry (Services → Affiliate Program) requires the mlm extension
to be enabled and the viewer to be signed in. Services → Referral Program, and
the footer's Referral Program link, additionally require Require Affiliate
Applications to be on: the Referral Program exists beside an Affiliate Program
that takes applications and not otherwise.
If a permissioned admin reports a missing menu, check the extension row before you check the role.
Where the enforcement actually is
Worth knowing when you are debugging an unexpected 403 or an unexpected success:
- Admin API routes carry a
permissionin their metadata and are checked on every request. - Admin pages carry a
permission.tsfile, checked when the route renders — except the Conditions page, which has none. - Member API routes check only that a session exists, apart from the
public ones, which read the session when there is one. There is no permission
layer on
/api/affiliate/*. What a caller may do is decided by their standing: choosing a personal code needs an approved affiliate. - The reward engine checks that the
mlmextension is enabled before it does anything, regardless of who triggered the underlying transaction.
Related: API and data model.