marko/authorization

Policy-based authorization with Gates and Policies for Marko Framework

Maintainers

Package info

github.com/marko-php/marko-authorization

Type:marko-module

pkg:composer/marko/authorization

Statistics

Installs: 4

Dependents: 0

Suggesters: 0

Stars: 0

0.0.1 2026-03-25 17:53 UTC

This package is auto-updated.

Last update: 2026-03-25 21:07:27 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\Contracts\GateInterface;

// Define an ability
$gate->define(
    'edit-settings',
    fn (?AuthorizableInterface $user) => $user?->can('admin', true) ?? false,
);

// Check it
$gate->authorize('edit-settings');

Documentation

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