Skip to content
This page is not yet translated. Showing English content.

Capabilities & Permissions ​

Channel partner capabilities determine which API endpoints a partner can access. Capabilities are defined by the PartnerCapabilityType enum, granted or revoked by e2c staff in the boss admin panel, and enforced by ChannelPartnerAuthMiddleware per request path.

Available Capabilities ​

CapabilityDescriptionEnforced scope
outbound_submitSubmit outbound requests, read outbound orders, dispatch/channel/api/v1/outbound/* (except attachment/evidence sub-paths), /channel/api/v1/dispatch/*
outbound_viewOutbound viewing capability; granted only on the registration path together with outbound_submit; editing a member in the admin panel grants only outbound_submit + inventory_view and never this capability alone—
outbound_attachment_uploadUpload, update, delete and batch-process outbound attachments/channel/api/v1/outbound/attachment/*
outbound_evidence_viewRead-only access to warehouse execution evidence/channel/api/v1/outbound/evidence/*
outbound_webhook_manageManage outbound webhook subscriptions/channel/api/v1/webhook/*
inventory_viewView owned inventory/channel/api/v1/inventory/*
platform_stockInclude platform-owned stock in inventory queries and outbound deductionNo path gate; the inventory/outbound services check the capability

Path Enforcement Rules ​

The middleware matches a path prefix and checks the mapped capability; a missing capability returns business code 606:

  • api/v1/outbound/attachment/ → outbound_attachment_upload
  • api/v1/outbound/evidence/ → outbound_evidence_view
  • api/v1/webhook/ → outbound_webhook_manage
  • api/v1/inventory/ → inventory_view
  • api/v1/outbound/ → outbound_submit
  • api/v1/dispatch/ → outbound_submit

Orders (order/*), products, shops, cart drafts and reconciliation paths do not check capabilities; a valid token is enough. platform_stock is a data-scope capability and never a path gate.

Default Grants ​

  • Registration with warehouse in user_types: all 7 capabilities are granted automatically (outbound_submit, outbound_view, outbound_attachment_upload, outbound_evidence_view, outbound_webhook_manage, inventory_view, platform_stock).
  • Registration without warehouse: no capability is granted automatically; staff must grant them explicitly.
  • Editing a member in the admin panel and setting user_types to warehouse / warehouse_operator: grants outbound_submit + inventory_view; removing those roles revokes the same two capabilities.
  • Capability rows are keyed by member_id + capability; only active=1 counts.

Checking Capabilities ​

POST /channel/api/v1/auth/me returns the user profile and granted capabilities (the endpoint is inside the auth/* whitelist and resolves Authorization: Bearer itself):

json
{
  "code": 200,
  "data": {
    "id": 1,
    "member_id": 42,
    "email": "ops@example.com",
    "name": "Ops",
    "role": "admin",
    "is_primary": true,
    "user_type": "buyer,warehouse",
    "capabilities": [
      "outbound_submit",
      "outbound_view",
      "outbound_attachment_upload",
      "outbound_evidence_view",
      "outbound_webhook_manage",
      "inventory_view",
      "platform_stock"
    ]
  }
}

/auth/me does not return a menu field. The portal sidebar is generated by the frontend from capabilities; the API promises no menu structure.

Portal Menu ​

The partner portal renders its sidebar from capabilities: without inventory_view there is no Inventory entry, without outbound_submit no Outbound entry, and without outbound_webhook_manage no Webhook settings.

Admin Management ​

e2c staff can grant or revoke capabilities via the boss admin panel:

  1. Navigate to CRM → Members
  2. Find the channel_partner member
  3. Click Capabilities in the action column
  4. Toggle individual capabilities on/off

Or via admin API:

  • POST /api/v1/partner/capability/grant — { member_id, capability }
  • POST /api/v1/partner/capability/revoke — { member_id, capability }
  • POST /api/v1/partner/capability/list — { member_id }