Role Based Access Control

Role Based Access Control

BESSE implements a comprehensive Role-Based Access Control (RBAC) system to manage user permissions across the platform. The system defines eight distinct stakeholder roles, each with specific capabilities and restrictions based on their position in the recycling value chain.

Role Definitions

1. Municipality (role_municipality)

Description: Municipal or local government entities that manage waste collection and recycling programs.

Capabilities:

  • ✅ Can create auctions
  • ✅ Can create assets with "Mixed Recyclables" material type only
  • ✅ Access to Dashboard, Orders, and Scanner
  • ❌ Cannot view auctions on home page (hidden role)
  • ❌ Cannot bid on auctions
  • ❌ Cannot create assets with other material types

2. Hauler (role_hauler)

Description: Waste hauling companies responsible for collecting and transporting materials.

Capabilities:

  • ✅ Can create assets (all material types)
  • ✅ Access to Dashboard, Orders, and Scanner
  • ❌ Cannot create auctions
  • ❌ Cannot view auctions on home page (hidden role)
  • ❌ Cannot bid on auctions

3. MRF (role_mrf)

Description: Material Recycling Facility - facilities that process and sort recyclable materials.

Capabilities:

  • ✅ Can create auctions
  • ✅ Can view auctions on home page
  • ✅ Can bid on auctions with "Mixed Recyclables" material type
  • ✅ Can create assets with all material types EXCEPT "Mixed Recyclables"
  • ✅ Access to Dashboard, Orders, and Scanner
  • ❌ Cannot bid on other material type auctions

4. Transportation Company (role_transportation_company)

Description: Transportation companies that handle logistics and shipping of materials.

Capabilities:

  • ✅ Can create assets (all material types)
  • ✅ Access to Dashboard, Orders, and Scanner
  • ❌ Cannot create auctions
  • ❌ Cannot view auctions on home page (hidden role)
  • ❌ Cannot bid on auctions

5. Broker (role_broker)

Description: Intermediaries who facilitate transactions between buyers and sellers in the recycling market.

Capabilities:

  • ✅ Can create auctions
  • ✅ Can view auctions on home page
  • ✅ Can bid on all auction types (both "Mixed Recyclables" and other materials)
  • ✅ Can create assets with all material types (no restrictions)
  • ✅ Access to Dashboard, Orders, and Scanner

6. Remanufacturer/Mill (role_remanufacturer_mill)

Description: Facilities that process recycled materials into new products or raw materials for manufacturing.

Capabilities:

  • ✅ Can view auctions on home page
  • ✅ Can bid on auctions with non-"Mixed Recyclables" material types
  • ✅ Can create assets (all material types)
  • ✅ Access to Dashboard, Orders, and Scanner
  • ❌ Cannot create auctions
  • ❌ Cannot bid on "Mixed Recyclables" auctions

7. Landfill (role_landfill)

Description: Landfill operators that manage waste disposal sites.

Capabilities:

  • ✅ Can create assets (all material types)
  • ✅ Access to Dashboard, Orders, and Scanner
  • ❌ Cannot create auctions
  • ❌ Cannot view auctions on home page (hidden role)
  • ❌ Cannot bid on auctions

8. Admin (role_admin)

Description: System administrators with full platform access and configuration capabilities.

Capabilities:

  • ✅ Full access to System Configuration page
  • ✅ Can deploy smart contracts (Auction Factory)
  • ✅ Can configure WARM settings
  • ✅ Can manage welcome ETH bonuses
  • ✅ System monitoring and status overview
  • ✅ Inherits all permissions of their assigned role (if they have one)

Note: Admin status is determined by wallet address verification, not role assignment.

Permissions Matrix

Auction Management

ActionMunicipalityHaulerMRFTransportationBrokerRemanufacturer/MillLandfillAdmin
Create Auction✅❌✅❌✅❌❌❌*
View Auctions❌❌✅❌✅✅❌✅
Bid on Auctions❌❌✅**❌✅✅***❌❌*

*Admin permissions depend on their assigned role
**Can bid on Mixed Recyclables only
***Can bid on non-Mixed Recyclables only

Asset Management

ActionMunicipalityHaulerMRFTransportationBrokerRemanufacturer/MillLandfillAdmin
Create Assets✅✅✅✅✅✅✅✅
Material RestrictionsMixed Recyclables onlyAllAll except Mixed RecyclablesAllAllAllAllNone

Navigation & Access

FeatureMunicipalityHaulerMRFTransportationBrokerRemanufacturer/MillLandfillAdmin
Home Page✅✅✅✅✅✅✅✅
Dashboard✅✅✅✅✅✅✅✅
Orders✅✅✅✅✅✅✅✅
Scanner✅✅✅✅✅✅✅✅
System Config❌❌❌❌❌❌❌✅

Material Type-Based Access Control

The platform implements material type-based access control for auction viewing and bidding:

Mixed Recyclables

Who can bid:

  • ✅ Broker
  • ✅ MRF

Who can create assets:

  • ✅ Municipality (only this type)
  • ✅ Broker
  • ❌ MRF (cannot create Mixed Recyclables)

Other Material Types

Who can bid:

  • ✅ Broker
  • ✅ Remanufacturer/Mill

Who can create assets:

  • ✅ All roles (except Municipality can only create Mixed Recyclables)

Asset Tracking Permissions

Each role can record specific types of tracking events throughout the supply chain:

RoleAllowed Tracking Events
Municipalitycreated, picked_up, custom
Haulerpicked_up, in_transit, at_facility, custom
MRFat_facility, processing, processed, shipped, custom
Transportationin_transit, shipped, delivered, custom
Brokerreceived, shipped, custom
Remanufacturer/Millreceived, processing, processed, recycled, custom
Landfillreceived, disposed, custom

Route-Level Permissions

Public Routes

  • / (Home) - All users
  • /register - Unauthenticated users only

Authenticated Routes (All Roles)

  • /dashboard - All authenticated users
  • /orders - All authenticated users
  • /enter-code (Scanner) - All authenticated users
  • /assets/create - All authenticated users
  • /auction/:id (Auction Details) - Access controlled by material type and role

Role-Restricted Routes

  • /auctions/create (Create Auction)
    • ✅ Broker
    • ✅ MRF
    • ✅ Municipality
    • ❌ All other roles

Admin-Only Routes

  • /system-config (System Configuration)
    • ✅ Admin (wallet address verification)
    • ❌ All other users

Important Notes

  1. Own Auction Restriction: Users cannot bid on their own auctions, regardless of role.

  2. Hidden Roles: The following roles are hidden from auction listings on the home page:

  • Hauler
    • Transportation
  • Landfill
    • Municipality
  1. Role Assignment: Roles are assigned during user registration and stored in the user's profile.

  2. Admin Verification: Admin status is separate from role assignment and is determined by wallet address matching a predefined admin address.

  3. Material Type Mapping: The platform uses the WARM (Waste and Recycling Management) system to map material types. Access to auctions is determined by the material type of the asset being auctioned.