license: built full stack, test and documentation
This commit is contained in:
24
backend/routes/api/licenses.php
Normal file
24
backend/routes/api/licenses.php
Normal file
@@ -0,0 +1,24 @@
|
||||
<?php
|
||||
|
||||
use App\Http\Controllers\LicenseController;
|
||||
use Illuminate\Support\Facades\Route;
|
||||
|
||||
// rotte pubbliche con throttling: le licenze sono informazione pubblica
|
||||
// (mostrate anche nelle pagine di dettaglio non autenticate).
|
||||
Route::middleware('throttle:public')->group(function () {
|
||||
Route::apiResource('licenses', LicenseController::class)
|
||||
->only(['index', 'show']);
|
||||
});
|
||||
|
||||
// Prefisso `api` e tier applicati dal loader in bootstrap/app.php.
|
||||
|
||||
// Lettura dello stato d'uso: utente pienamente operativo.
|
||||
Route::middleware('tier.app')->group(function () {
|
||||
Route::get('licenses/{license}/usage', [LicenseController::class, 'usage']);
|
||||
});
|
||||
|
||||
// Scrittura: solo Admin.
|
||||
Route::middleware('tier.admin')->group(function () {
|
||||
Route::apiResource('licenses', LicenseController::class)
|
||||
->only(['store', 'update', 'destroy']);
|
||||
});
|
||||
Reference in New Issue
Block a user