FEATURE #2048: prepare routes for ACL, add some more permissions

This commit is contained in:
Michal Kváček
2017-08-11 02:07:31 +02:00
parent cccdbda543
commit 335ec4a167
41 changed files with 836 additions and 489 deletions
+16 -8
View File
@@ -2,7 +2,8 @@
Route::group(['namespace' => 'Contents'], function () {
// list of all static pages
Route::get('content/overview/{module?}', 'ContentOverview@index')
->name('content.overview');
->name('content.overview')
->middleware('can:manage,' . \App\Models\Content\Content::class);
// form for creating new static page
Route::get('content/new/{module}', 'CreateNewContent@create')
@@ -16,29 +17,36 @@ Route::group(['namespace' => 'Contents'], function () {
// post method for creating new static page
Route::post('content/new/{module}', 'CreateNewContent@store')
->name('content.newPost');
->name('content.newPost')
->middleware('can:create,module');
// post method for creating new static page
Route::post('content/edit/{page}', 'EditContent@update')
->name('content.editPost');
->name('content.editPost')
->middleware('can:update,page');
// change status of page (protected, public or draft)
Route::get('content/status/{page}/{status}', 'ContentActions@changeStatus')
->name('content.changeStatus');
->name('content.changeStatus')
->middleware('can:changeStatus,page');
// set homepage
Route::get('content/homepage/{page}', 'ContentActions@setHomepage')
->name('content.setHomepage');
->name('content.setHomepage')
->middleware('can:setHomepage,page');
// delete page
Route::get('content/delete/{page}', 'ContentActions@delete')
->name('content.delete');
->name('content.delete')
->middleware('can:delete,page');
// history of changes for specified page
Route::get('history/{page}', 'History@getOverview')
->name('content.history');
->name('content.history')
->middleware('can:viewHistory,page');
// history of changes for specified page
Route::get('history/{revision}', 'History@getDiff')
->name('history.diff');
->name('history.diff')
->middleware('can:viewHistory,page');
});