diff --git a/app/Http/Controllers/TeamController.php b/app/Http/Controllers/TeamController.php index fc0629b..2ae2add 100644 --- a/app/Http/Controllers/TeamController.php +++ b/app/Http/Controllers/TeamController.php @@ -61,6 +61,8 @@ class TeamController extends Controller public function create_team() { + $this->authorize('admin'); + // Get list of current used colors $teams = DB::table('teams')->pluck('name')->toArray(); $color_names = array_values(self::colors()); @@ -84,6 +86,8 @@ class TeamController extends Controller public function add_player(Request $request) { + $this->authorize('admin'); + try { // Look up the user ID $profile = Twitter::getUsers(['screen_name' => trim($request->input('twitter'), '@')]); @@ -107,9 +111,4 @@ class TeamController extends Controller return response()->json(['error'=>$e->getMessage()]); } } - - public function remove_player() - { - - } } diff --git a/resources/views/layouts/app.blade.php b/resources/views/layouts/app.blade.php index 9714389..b82f8be 100644 --- a/resources/views/layouts/app.blade.php +++ b/resources/views/layouts/app.blade.php @@ -36,7 +36,10 @@
@endforeach + @can('admin')