1<?php
2
3// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the GNU Affero General Public License v3.0.
4// See the LICENCE file in the repository root for full licence text.
5
6namespace App\Http\Controllers\Admin;
7
8use App\Http\Controllers\Controller as BaseController;
9use Auth;
10
11abstract class Controller extends BaseController
12{
13 public function __construct()
14 {
15 $this->middleware('auth');
16
17 $this->middleware(function ($request, $next) {
18 if (Auth::check() && !Auth::user()->isAdmin()) {
19 abort(403);
20 }
21
22 return $next($request);
23 });
24
25 parent::__construct();
26 }
27}