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