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