<?php namespace Bixo\Account\Policies; use Bixo\Account\Models\Bank; use Illuminate\Foundation\Auth\User as Authenticatable; trait BankWorkflow { /** * Determine if the given user can approve the given bank. * * @param Authenticatable $user * * @return bool */ public function approve(Authenticatable $user, Bank $bank) { if ($user->canDo('account.bank.approve')) { return true; } return false; } /** * Determine if the given user can approve the given bank. * * @param Authenticatable $user * * @return bool */ public function submit(Authenticatable $user, Bank $bank) { if ($user->canDo('account.bank.submit')) { return true; } return false; } /** * Determine if the given user can approve the given bank. * * @param Authenticatable $user * * @return bool */ public function publish(Authenticatable $user, Bank $bank) { if ($user->canDo('account.bank.publish')) { return true; } return false; } /** * Determine if the given user can approve the given bank. * * @param Authenticatable $user * * @return bool */ public function unpublish(Authenticatable $user, Bank $bank) { if ($user->canDo('account.bank.unpublish')) { return true; } return false; } /** * Determine if the given user can approve the given bank. * * @param Authenticatable $user * * @return bool */ public function archive(Authenticatable $user, Bank $bank) { if ($user->canDo('account.bank.archive')) { return true; } return false; } /** * Determine if the given user can approve the given bank. * * @param Authenticatable $user * * @return bool */ public function unarchive(Authenticatable $user, Bank $bank) { if ($user->canDo('account.bank.unarchive')) { return true; } return false; } /** * Determine if the given user can approve the given bank. * * @param Authenticatable $user * * @return bool */ public function reject(Authenticatable $user, Bank $bank) { if ($user->canDo('account.bank.reject')) { return true; } return false; } }