public function defineAbilities()
    {
        $this->gate->before(function ($user, $ability) {
            if ($user->isSuperuser()) return true;
        });

        foreach ($this->getPermissions() as $permission) {
            $this->gate->define($permission->name, function ($user) use ($permission) {
                return $user->hasPermission($permission->name);
            });
        }
    }