<?php namespace Bixo\Account\Policies; use Bixo\Account\Models\Customer; use Illuminate\Foundation\Auth\User as Authenticatable; trait CustomerAction { /** * Determine if the given user can copy the given customer. * * @param Authenticatable $user * * @return bool */ public function copy(Authenticatable $user, Customer $customer) { if ($authUser->canDo('account.customer.action.copy')) { return true; } $this->model->is_owner; } /** * Determine if the given user can empty the given customer. * * @param Authenticatable $user * * @return bool */ function empty(Authenticatable $user, Customer $customer) { if ($authUser->canDo('account.customer.action.empty')) { return true; } $this->model->is_owner; } /** * Determine if the given user can transfer the given customer. * * @param Authenticatable $user * * @return bool */ public function transfer(Authenticatable $user, Customer $customer) { if ($authUser->canDo('account.customer.action.transfer')) { return true; } $this->model->is_owner; } }