Is your feature request related to a problem? Please describe.
Hey, i don't really understand with badaso permission. Why would we need to define many permissions add, delete, edit etc for each database table? I mean right now its looks like: brower_tablename, edit_tablename for every table. It was such a pain to set all of them, if i have many tables
Describe the solution you'd like
Why not define by role? I think its more simple like so:
user_access
admin_access
all_access
Describe alternatives you've considered
For example every route that define by user_access permission is only accessable by user. If we want to set it to spesific route controller middleware, just set like this:
Route::group(['prefix' => 'table'], function () {
// Just spesific role can access this
Route::get('', [TableController::class, 'browse'])->middleware([BadasoCheckPermissions::class . ':user_access']);
Route::get('{id}', [TableController::class, 'read'])->middleware([BadasoCheckPermissions::class . ':admin_access']);
//or maybe define the list access by comma
Route::get('{id}', [TableController::class, 'delete'])->middleware([BadasoCheckPermissions::class . ':admin_access,:user_access']);
//all role can access all
Route::post('', [TableController::class, 'add'])->middleware([BadasoCheckPermissions::class . ':all_access']);
// or i don't define route middleware if you want to allow all role access the controller
Route::put('{id}', [TableController::class, 'edit'])
});
Is your feature request related to a problem? Please describe. Hey, i don't really understand with badaso permission. Why would we need to define many permissions add, delete, edit etc for each database table? I mean right now its looks like: brower_tablename, edit_tablename for every table. It was such a pain to set all of them, if i have many tables
Describe the solution you'd like Why not define by role? I think its more simple like so: user_access admin_access all_access
Describe alternatives you've considered For example every route that define by user_access permission is only accessable by user. If we want to set it to spesific route controller middleware, just set like this:
Additional context I don't have any