Skip to content

Framework setup

Use the framework-neutral core on its own, or opt into HTTP admission on selected routes. The package does not install middleware or make routes public by default.

Choose your adapter

Framework Permission setup Feature setup
Slim PSR-15 route middleware Slim composition
Yii 3 PSR-15 route middleware Yii 3 composition
Symfony Native subscriber Native Feature setup
Laravel Native middleware Native Feature setup
CodeIgniter 4 Native before-filter Native Feature setup

Declare a protected action

For adapters that consume portable Permission attributes, declare what the action requires. The framework must still run the appropriate admission adapter before invoking the action.

use Fight\AccessControl\Application\AccessControl\Authorization\Attribute\RequiresPermission;

final class Orders
{
    #[RequiresPermission('ORDERS_EXPORT')]
    public function export(): void
    {
        // Export only records the admitted caller may access.
    }
}

Use the framework guide to bind admission to the exact action selected by the trusted router. Decide explicitly whether each action is public, requires authentication, or requires Permissions. Give admission fresh User or Agent authority from your authentication services, not request-supplied claims or a copied SecurityContext.

Portable metadata can add requirements, not grant access by itself. Protect direct, worker and bus entry points separately, and check record or tenant scope within the application even after HTTP admission succeeds. Read the portable Permission contract for the composition rules.