feat: enhance risk pool management and role validation
- Updated AGENTS.md to streamline information on risk pool operations and agent account restrictions. - Introduced filtering options in AdminRiskPoolIndexController for active risk pools. - Refactored AdminRiskPoolLockLogIndexController to support grouping by ticket or entry. - Enhanced AdminRoleStoreController and AdminRoleUpdateController to prevent the use of reserved slugs for new roles. - Improved error messaging for role creation and updates to clarify reserved role restrictions. - Added new API routes for ticket item retrieval to improve admin functionalities.
This commit is contained in:
@@ -39,7 +39,21 @@ final class AdminRoleUpdateController extends Controller
|
||||
}
|
||||
}
|
||||
if (isset($payload['slug'])) {
|
||||
$payload['code'] = $payload['slug'];
|
||||
$nextSlug = strtolower(trim((string) $payload['slug']));
|
||||
if (
|
||||
PlatformSystemRoles::isFixedSlug($nextSlug)
|
||||
&& $nextSlug !== (string) $admin_role->slug
|
||||
) {
|
||||
return ApiMessage::errorResponse(
|
||||
$request,
|
||||
'admin.role_slug_reserved',
|
||||
ErrorCode::ValidationFailed->value,
|
||||
['slug' => $nextSlug],
|
||||
422,
|
||||
);
|
||||
}
|
||||
$payload['slug'] = $nextSlug;
|
||||
$payload['code'] = $nextSlug;
|
||||
}
|
||||
|
||||
$admin_role->fill($payload);
|
||||
|
||||
Reference in New Issue
Block a user