class Policy implements ExtenderInterface

Methods

globalPolicy(string $policy)

Add a custom policy for when an ability check is ran without a model instance.

modelPolicy(string $modelClass, string $policy)

Add a custom policy for when an ability check is ran on an instance of a model.

extend(Container $container, Extension $extension = null)

No description

Details

globalPolicy(string $policy)

Add a custom policy for when an ability check is ran without a model instance.

Parameters

string $policy ::class attribute of policy class, which must extend Flarum\User\Access\AbstractPolicy

modelPolicy(string $modelClass, string $policy)

Add a custom policy for when an ability check is ran on an instance of a model.

Parameters

string $modelClass The ::class attribute of the model you are applying policies to. This model should extend from \Flarum\Database\AbstractModel.
string $policy ::class attribute of policy class, which must extend Flarum\User\Access\AbstractPolicy

extend(Container $container, Extension $extension = null)

Parameters

Container $container
Extension $extension