class Policy implements ExtenderInterface

Methods

globalPolicy(string $policy)

<p>Add a custom policy for when an ability check is ran without a model instance.</p>

modelPolicy(string $modelClass, string $policy)

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

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

No description

Details

globalPolicy(string $policy)

<p>Add a custom policy for when an ability check is ran without a model instance.</p>

Parameters

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

modelPolicy(string $modelClass, string $policy)

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

Parameters

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

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

Parameters

Container $container
Extension $extension