@@ -19,7 +19,7 @@ Install the package:
1919composer require andreaselia/laravel-firefly
2020```
2121
22- Publish package files:
22+ Publish package files (config, migrations, assets and views) :
2323
2424``` bash
2525php artisan vendor:publish --provider=" Firefly\FireflyServiceProvider"
@@ -80,6 +80,40 @@ You can enable a WYSIWYG editor by adding / updating the flag in the config:
8080This uses the Quill WYSIWYG editor library, docs can be found at: https://quilljs.com/docs .
8181The snow theme and basic editing controls are provided out of the box in the config, but these can be modified to fit your needs.
8282
83+ ### Policies
84+
85+ By default, Firefly policies are very permissive. In order to adapt the permissions model to your own application, please use
86+ your AuthServiceProvider file :
87+
88+ 1 . Create your policy files : ` php artisan make:policy MyGroupPolicy `
89+ 2 . In the generated class, extend the base Firefly policy :
90+
91+ ``` php
92+ <?php
93+
94+ namespace App\Policies;
95+
96+ use Illuminate\Auth\Access\HandlesAuthorization;
97+ use Firefly\Policies\GroupPolicy;
98+
99+ class MyGroupPolicy extends GroupPolicy {
100+ ...
101+ ```
102+
103+ 3 . Implement whatever policy you wish (use the policies in ` vendor/andreaselia/laravel-firefly/src/Policies ` for reference)
104+ 4 . Update the policies array in ` app/Providers/AuthServiceProvider.php ` :
105+
106+ ``` php
107+ ...
108+ use Firefly\Models\Group;
109+ ...
110+ protected $policies = [
111+ Group::class => 'App\Policies\MyGroupPolicy',
112+ ];
113+ ```
114+
115+ Learn more at https://laravel.com/docs/8.x/authorization#registering-policies
116+
83117## Contributing
84118
85119You're more than welcome to submit a pull request, or if you're not feeling up to it - create an issue so someone else can pick it up.
0 commit comments