<?php

namespace Bixo\Account\Policies;

use Bixo\Account\Models\Costcenter;
use Illuminate\Foundation\Auth\User as Authenticatable;

trait CostcenterAction
{

    /**
     * Determine if the given user can copy the given costcenter.
     *
     * @param Authenticatable $user
     *
     * @return bool
     */
    public function copy(Authenticatable $user, Costcenter $costcenter)
    {

        if ($authUser->canDo('account.costcenter.action.copy')) {
            return true;
        }

        $this->model->is_owner;
    }

    /**
     * Determine if the given user can empty the given costcenter.
     *
     * @param Authenticatable $user
     *
     * @return bool
     */
    function empty(Authenticatable $user, Costcenter $costcenter) {

        if ($authUser->canDo('account.costcenter.action.empty')) {
            return true;
        }

        $this->model->is_owner;
    }

    /**
     * Determine if the given user can transfer the given costcenter.
     *
     * @param Authenticatable $user
     *
     * @return bool
     */
    public function transfer(Authenticatable $user, Costcenter $costcenter)
    {

        if ($authUser->canDo('account.costcenter.action.transfer')) {
            return true;
        }

        $this->model->is_owner;
    }

}