Skip to content

Commit

Permalink
access level validation on api and frontend
Browse files Browse the repository at this point in the history
  • Loading branch information
mthstv committed May 22, 2020
1 parent e2d3ff3 commit 5713efc
Show file tree
Hide file tree
Showing 19 changed files with 37 additions and 1,129 deletions.
41 changes: 28 additions & 13 deletions api/routes/api.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,21 @@

Route::group(['middleware' => ['admin']], function () {
Route::resource('user', 'UserController')->except(['show']);

Route::resource('element', 'ElementController')->except(['index', 'show']);

Route::resource('rule', 'RuleController')->except(['index', 'show']);
Route::resource('part', 'PartController')->except(['index', 'show']);
Route::resource('book', 'BookController')->except(['index', 'show']);
Route::resource('title', 'TitleController')->except(['index', 'show']);
Route::resource('chapter', 'ChapterController')->except(['index', 'show']);
Route::resource('section', 'SectionController')->except(['index', 'show']);
Route::resource('subsection', 'SubsectionController')->except(['index', 'show']);
Route::resource('article', 'ArticleController')->except(['index', 'show']);
Route::resource('paragraph', 'ParagraphController')->except(['index', 'show']);
Route::resource('incise', 'InciseController')->except(['index', 'show']);
Route::resource('line', 'LineController')->except(['index', 'show']);
Route::resource('item', 'ItemController')->except(['index', 'show']);
});

/**
Expand All @@ -42,7 +57,7 @@
* /element/by-label/{label} => 'GET' @ findByLabel()
*/
Route::get('element/by-label/{label}', 'ElementController@findByLabel');
Route::resource('element', 'ElementController');
Route::resource('element', 'ElementController')->only(['index', 'show']);

/**
* /rule => 'GET' @ index()
Expand All @@ -53,7 +68,7 @@
*
*/
Route::post('rule/search', 'RuleController@search');
Route::resource('rule', 'RuleController');
Route::resource('rule', 'RuleController')->only(['index', 'show']);

/**
* /part => 'GET' @ index()
Expand All @@ -63,7 +78,7 @@
* /part/{id} => 'DELETE' @ destroy()
*
*/
Route::resource('part', 'PartController');
Route::resource('part', 'PartController')->only(['index', 'show']);

/**
* /book => 'GET' @ index()
Expand All @@ -73,7 +88,7 @@
* /book/{id} => 'DELETE' @ destroy()
*
*/
Route::resource('book', 'BookController');
Route::resource('book', 'BookController')->only(['index', 'show']);

/**
* /title => 'GET' @ index()
Expand All @@ -83,7 +98,7 @@
* /title/{id} => 'DELETE' @ destroy()
*
*/
Route::resource('title', 'TitleController');
Route::resource('title', 'TitleController')->only(['index', 'show']);

/**
* /chapter => 'GET' @ index()
Expand All @@ -93,7 +108,7 @@
* /chapter/{id} => 'DELETE' @ destroy()
*
*/
Route::resource('chapter', 'ChapterController');
Route::resource('chapter', 'ChapterController')->only(['index', 'show']);

/**
* /section => 'GET' @ index()
Expand All @@ -103,7 +118,7 @@
* /section/{id} => 'DELETE' @ destroy()
*
*/
Route::resource('section', 'SectionController');
Route::resource('section', 'SectionController')->only(['index', 'show']);

/**
* /subsection => 'GET' @ index()
Expand All @@ -113,7 +128,7 @@
* /subsection/{id} => 'DELETE' @ destroy()
*
*/
Route::resource('subsection', 'SubsectionController');
Route::resource('subsection', 'SubsectionController')->only(['index', 'show']);

/**
* /article => 'GET' @ index()
Expand All @@ -123,7 +138,7 @@
* /article/{id} => 'DELETE' @ destroy()
*
*/
Route::resource('article', 'ArticleController');
Route::resource('article', 'ArticleController')->only(['index', 'show']);

/**
* /paragraph => 'GET' @ index()
Expand All @@ -133,7 +148,7 @@
* /paragraph/{id} => 'DELETE' @ destroy()
*
*/
Route::resource('paragraph', 'ParagraphController');
Route::resource('paragraph', 'ParagraphController')->only(['index', 'show']);

/**
* /incise => 'GET' @ index()
Expand All @@ -143,7 +158,7 @@
* /incise/{id} => 'DELETE' @ destroy()
*
*/
Route::resource('incise', 'InciseController');
Route::resource('incise', 'InciseController')->only(['index', 'show']);

/**
* /line => 'GET' @ index()
Expand All @@ -153,7 +168,7 @@
* /line/{id} => 'DELETE' @ destroy()
*
*/
Route::resource('line', 'LineController');
Route::resource('line', 'LineController')->only(['index', 'show']);

/**
* /item => 'GET' @ index()
Expand All @@ -163,6 +178,6 @@
* /item/{id} => 'DELETE' @ destroy()
*
*/
Route::resource('item', 'ItemController');
Route::resource('item', 'ItemController')->only(['index', 'show']);

});
64 changes: 0 additions & 64 deletions front/src/components/dashboard/BrowserUsage.js

This file was deleted.

66 changes: 0 additions & 66 deletions front/src/components/dashboard/InfoBox.js

This file was deleted.

55 changes: 0 additions & 55 deletions front/src/components/dashboard/MonthlySales.js

This file was deleted.

50 changes: 0 additions & 50 deletions front/src/components/dashboard/NewOrders.js

This file was deleted.

Loading

0 comments on commit 5713efc

Please sign in to comment.