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