<?php

namespace App\Policies;

use Fivable\Buildable\Policies\BuildableSettingPolicy as BaseBuildableSettingPolicy;

class BuildableSettingPolicy extends BaseBuildableSettingPolicy
{

    /**
     * This Policy has been published for you by Buildable to allow you to easily override
     * any policy functions you need to in your application. Because this overrides
     * Buildable's own corresponding Policy, you will be able to update your
     * version of the Buildable package and maintain your custom Policy
     * methods, without risking the loss additions or changes from
     * the base class. Of course, if you've overridden anything
     * you will not effectively get the changes when updating
     */

//    /**
//     * If User is Superadmin, allow all
//     * @param $user
//     * @return bool|NULL
//     */
//    public function before(User $user)
//    {
//        if ($user->isSuperadmin()) {
//            return true;
//        }
//    }

//    /**
//     * Determine whether the User can view an index of BuildableSettings
//     * @param  User  $user
//     * @param  string|NULL
//     * @return bool
//     */
//    public function viewIndex(User $user, string $type = NULL) : bool
//    {
//        switch ($type) {
//            case 'superadmin':
//            case NULL:
//                return false;
//            case 'general':
//                return $user->isAdmin();
//            case 'customization':
//                return true;
//        }
//    }

//    /**
//     * Determine whether the User can update this BuildableSetting
//     * @param  User  $user
//     * @param  BuildableSetting  $buildableSetting
//     * @return bool
//     */
//    public function update(User $user, BuildableSetting $buildableSetting) : bool
//    {
//        switch ($buildableSetting->getTypeString()) {
//            case 'superadmin':
//            case NULL:
//                return false;
//            case 'general':
//                return $user->isAdmin();
//            case 'customization':
//                return true;
//        }
//    }
}
