permission.php 4.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124
  1. <?php
  2. return [
  3. // 超级管理员角色ID
  4. 'super_admin_role_id' => 1,
  5. // 权限配置 - 用于角色权限分配时的选项显示
  6. 'permissions' => [
  7. 'User' => [
  8. 'name' => '用户管理',
  9. 'actions' => [
  10. 'list' => '查看用户列表',
  11. 'create' => '创建用户',
  12. 'update' => '编辑用户',
  13. 'delete' => '删除用户',
  14. 'detail' => '查看用户详情'
  15. ]
  16. ],
  17. 'Player' => [
  18. 'name' => '玩家管理',
  19. 'actions' => [
  20. 'list' => '查看玩家列表',
  21. 'detail' => '查看玩家详情',
  22. 'updateStatus' => '更新玩家状态',
  23. 'updateAdjustStatus' => '更新玩家调控状态',
  24. 'statistics' => '查看玩家统计',
  25. 'batchUpdate' => '批量更新玩家',
  26. 'export' => '导出玩家数据'
  27. ]
  28. ],
  29. 'Game' => [
  30. 'name' => '游戏管理',
  31. 'actions' => [
  32. 'list' => '查看游戏列表',
  33. 'detail' => '查看游戏详情',
  34. 'create' => '创建游戏',
  35. 'update' => '更新游戏',
  36. 'updateStatus' => '更新游戏状态',
  37. 'batchUpdate' => '批量更新游戏',
  38. 'delete' => '删除游戏',
  39. 'statistics' => '查看游戏统计',
  40. 'export' => '导出游戏数据'
  41. ]
  42. ],
  43. 'UserRole' => [
  44. 'name' => '角色管理',
  45. 'actions' => [
  46. 'list' => '查看角色列表',
  47. 'create' => '创建角色',
  48. 'update' => '编辑角色',
  49. 'delete' => '删除角色',
  50. 'detail' => '查看角色详情',
  51. 'permissions' => '查看权限配置'
  52. ]
  53. ],
  54. 'Permission' => [
  55. 'name' => '权限管理',
  56. 'actions' => [
  57. 'list' => '查看权限配置',
  58. 'assign' => '分配权限'
  59. ]
  60. ],
  61. 'Menu' => [
  62. 'name' => '菜单管理',
  63. 'actions' => [
  64. 'list' => '查看菜单',
  65. 'tree' => '获取菜单树',
  66. 'breadcrumb' => '获取面包屑',
  67. 'permissions' => '查看菜单权限'
  68. ]
  69. ],
  70. 'Statistics' => [
  71. 'name' => '数据统计',
  72. 'actions' => [
  73. 'user' => '用户统计',
  74. 'merchant' => '商户统计',
  75. ]
  76. ]
  77. ],
  78. // 默认权限组合(用于快速分配)
  79. 'permission_groups' => [
  80. 'viewer' => [
  81. 'name' => '查看者',
  82. 'description' => '只有查看权限',
  83. 'permissions' => [
  84. 'User' => ['list', 'detail'],
  85. 'Player' => ['list', 'detail', 'statistics'],
  86. 'Game' => ['list', 'detail', 'statistics'],
  87. 'UserRole' => ['list', 'detail'],
  88. 'Merchant' => ['list', 'detail'],
  89. 'Statistics' => ['user', 'merchant', 'daily', 'monthly', 'yearly']
  90. ]
  91. ],
  92. 'operator' => [
  93. 'name' => '操作员',
  94. 'description' => '有基本的增删改查权限',
  95. 'permissions' => [
  96. 'User' => ['list', 'create', 'update', 'detail'],
  97. 'Player' => ['list', 'detail', 'updateStatus', 'statistics'],
  98. 'Game' => ['list', 'detail', 'updateStatus', 'statistics'],
  99. 'UserRole' => ['list', 'detail'],
  100. 'Merchant' => ['list', 'create', 'update', 'detail'],
  101. 'MerchantAudit' => ['pending', 'passed'],
  102. 'Statistics' => ['user', 'merchant', 'daily', 'monthly', 'yearly']
  103. ]
  104. ],
  105. 'admin' => [
  106. 'name' => '管理员',
  107. 'description' => '有完整的管理权限',
  108. 'permissions' => [
  109. 'User' => ['list', 'create', 'update', 'delete', 'detail'],
  110. 'Player' => ['list', 'detail', 'updateStatus', 'updateAdjustStatus', 'statistics', 'batchUpdate', 'export'],
  111. 'Game' => ['list', 'detail', 'create', 'update', 'updateStatus', 'batchUpdate', 'delete', 'statistics', 'export'],
  112. 'UserRole' => ['list', 'create', 'update', 'delete', 'detail', 'permissions'],
  113. 'Permission' => ['list', 'assign'],
  114. 'Menu' => ['list', 'tree', 'breadcrumb', 'permissions'],
  115. 'Merchant' => ['list', 'create', 'update', 'delete', 'detail'],
  116. 'MerchantAudit' => ['pending', 'passed', 'approve', 'reject'],
  117. 'Statistics' => ['user', 'merchant', 'daily', 'monthly', 'yearly', 'income', 'users']
  118. ]
  119. ]
  120. ]
  121. ];