Demo

permissions.ts
const permissions = {
  total_revenue: false,
  new_customers: false,
  active_accounts: false,
  growth_rate: false,
  total_visitors: false,          
}
 
const adminRole = { 
  id: 'admin',
  permissions: {
    total_revenue: true,
    new_customers: true,
    active_accounts: true,
    growth_rate: true,
    total_visitors: true,
  },
}
 
const userRole = {
  id: 'user',
  permissions: {
    total_revenue: true,
    growth_rate: (user) => user.credits > 10 
  },
}
 
const puedo = new Puedo({
  accessorKey: "role",
  roles: [adminRole, userRole] 
  permissions           
})
 
Total Revenue
$1,250.00
+12.5%
Trending up this month
Visitors for the last 6 months
New Customers
1,234
-20%
Down 20% this period
Acquisition needs attention
Active Accounts
45,678
+12.5%
Strong user retention
Engagement exceed targets
Growth Rate
4.5%
+4.5%
Steady performance increase
Meets growth projections
Total Visitors
Last 3 months