<?php

use Illuminate\Support\Facades\Route;
use Modules\Role\Http\Controllers\RoleController;

// Protected routes (auth required)
Route::middleware(['auth:sanctum'])->prefix('v1')->group(function () {
    Route::apiResource('roles', RoleController::class)->names('role');
    
    // Permission management routes
    Route::get('permissions', [RoleController::class, 'permissions'])->name('permissions.index');
    Route::post('roles/{role}/permissions', [RoleController::class, 'assignPermissions'])->name('roles.permissions.assign');
});