kineticamobile / lumki

Laravel 8 Users Management. Add-on to Jetstream, using spatie/laravel-permissions & lab404/laravel-impersonate
Other
75 stars 26 forks source link

Add the permission access field to the config #10

Closed shbov closed 3 years ago

shbov commented 3 years ago

Hi, it seems to me that we need to add the ability to change the access permission to the package. Something like this:

config/lumki.php


<?php

$permissionAccess = 'users.edit.*';

return [
    "prefix" => 'lumki',
    "permissionAccess" => $permissionAccess,
    "middleware" => ['web', 'auth:sanctum', 'can:'.$permissionAccess],
    'custom_fields' => [
        // [
        //     'type' => 'text',
        //     'name' => 'username',
        //     'label' => 'Username',
        //     'placeholder' => 'Username',
        // ],
    ]
];```
raultm commented 3 years ago

Maybe you can explain a bit more. I don't see the point to implement something like this. In fact you already have the ability to change the access permission

<?php

return [
    "prefix" => 'lumki',
    "middleware" => ['web', 'auth:sanctum', 'can:users.edit.*'],
    ]
];

Are you using config('lumki.permissionAccess') in the application?

What's the needed of permissionAccess key in the config file if the package is not using it and you can modified the middlewares via config file?

I'm not rejecting the idea, I only want to visualize a few examples where it can be useful

shbov commented 3 years ago

Right now, we only have the option to change the middleware access permissions, but we can't change the blade @can ("user manage").

raultm commented 3 years ago

Ok, i get it

raultm commented 3 years ago

I think theses changes resolve this issue