- 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.
50 lines
1.4 KiB
PHP
50 lines
1.4 KiB
PHP
<?php
|
|
|
|
namespace App\Support;
|
|
|
|
use App\Models\AdminRole;
|
|
|
|
/** 平台「站点客服」内置角色:单玩家查询,不含全局经营报表与代理管理。 */
|
|
final class SiteCsDefaultRolePermissions
|
|
{
|
|
/** @var list<string> */
|
|
private const TEMPLATE_SLUGS = [
|
|
'prd.dashboard.view',
|
|
'prd.users.view_cs',
|
|
'prd.tickets.view',
|
|
'prd.wallet_reconcile.view_cs',
|
|
];
|
|
|
|
/** @return list<string> */
|
|
public static function templateSlugs(): array
|
|
{
|
|
return self::TEMPLATE_SLUGS;
|
|
}
|
|
|
|
public static function ensurePlatformSiteCsRole(): AdminRole
|
|
{
|
|
$role = AdminRole::query()->updateOrCreate(
|
|
[
|
|
'slug' => SiteOperatorRoles::SLUG_SITE_CS,
|
|
'scope_type' => AdminRole::SCOPE_SYSTEM,
|
|
],
|
|
[
|
|
'code' => SiteOperatorRoles::SLUG_SITE_CS,
|
|
'name' => '站点客服',
|
|
'description' => '单站客服:玩家/注单/单用户钱包查询工作台,不含全局报表与代理经营',
|
|
'status' => 1,
|
|
'is_system' => true,
|
|
'sort_order' => 42,
|
|
'owner_agent_id' => null,
|
|
'delegated_from_role_id' => null,
|
|
],
|
|
);
|
|
|
|
$role->syncLegacyPermissionSlugs(
|
|
AdminPermissionInheritance::expand(self::TEMPLATE_SLUGS),
|
|
);
|
|
|
|
return $role->fresh() ?? $role;
|
|
}
|
|
}
|