Files
lotteryLaravel/app/Support/SiteFinanceDefaultRolePermissions.php
kang 4e370a79dc feat: enhance admin role management and reconciliation features
- Updated AGENTS.md to clarify site admin roles and their associated permissions.
- Refactored reconciliation controllers to include admin user validation and improved access control based on admin roles.
- Enhanced AdminReconcileJobService to support player-specific reconciliation and site-based job creation.
- Removed deprecated rebate commission report functionality from the API and related services.
- Improved dashboard overview builders to accommodate new site operator roles and their specific functionalities.
2026-06-16 16:04:01 +08:00

56 lines
1.6 KiB
PHP

<?php
namespace App\Support;
use App\Models\AdminRole;
/** 平台「站点财务」内置角色:对账、报表导出、结算收付,不含代理树经营。 */
final class SiteFinanceDefaultRolePermissions
{
/** @var list<string> */
private const TEMPLATE_SLUGS = [
'prd.dashboard.view',
'prd.draw_result.view',
'prd.users.view_finance',
'prd.tickets.view',
'prd.report.view',
'prd.report.export',
'prd.wallet_reconcile.manage',
'prd.wallet_adjust.manage',
'prd.settlement.agent.view',
'prd.settlement.agent.manage',
];
/** @return list<string> */
public static function templateSlugs(): array
{
return self::TEMPLATE_SLUGS;
}
public static function ensurePlatformSiteFinanceRole(): AdminRole
{
$role = AdminRole::query()->updateOrCreate(
[
'slug' => SiteOperatorRoles::SLUG_SITE_FINANCE,
'scope_type' => AdminRole::SCOPE_SYSTEM,
],
[
'code' => SiteOperatorRoles::SLUG_SITE_FINANCE,
'name' => '站点财务',
'description' => '单站财务/对账:钱包流水、对账、经营报表导出、信用结算收付',
'status' => 1,
'is_system' => true,
'sort_order' => 41,
'owner_agent_id' => null,
'delegated_from_role_id' => null,
],
);
$role->syncLegacyPermissionSlugs(
AdminPermissionInheritance::expand(self::TEMPLATE_SLUGS),
);
return $role->fresh() ?? $role;
}
}