Search by

marko / authorization

markshust

Policy-based authorization with Gates and Policies for Marko Framework

Package info

github.com/marko-php/marko-authorization

Type:marko-module

pkg:composer/marko/authorization

Statistics

Installs: 93

Dependents: 1

Suggesters: 0

Stars: 0

0.11.0 2026-10-06 14:15 UTC

README

Gates, policies, and the #[Can] attribute -- control who can do what with expressive, testable authorization checks.

Installation

composer require marko/authorization

Quick Example

use Marko\Authorization\Attributes\Can;
use Marko\Routing\Attributes\Get;
use Marko\Routing\Http\Response;

class AdminController
{
    // Enforced on every request once the package is installed: 401 if logged out, 403 if denied
    #[Get('/admin')]
    #[Can('admin.access')]
    public function dashboard(): Response
    {
        return new Response('Welcome');
    }
}

Documentation

Full usage, API reference, and examples: marko/authorization