is($this->model->owner())) { return true; } if ($authUser->canDo('deal.deal.action.copy')) { return true; } return false; } /** * Determine if the given user can approve the given deal. * * @param UserPolicyInterface $authUser * * @return bool */ function empty(UserPolicyInterface $authUser, Deal $deal) { if ($authUser->is($this->model->owner())) { return true; } if ($authUser->canDo('deal.deal.action.empty')) { return true; } return false; } /** * Determine if the given user can approve the given deal. * * @param UserPolicyInterface $authUser * * @return bool */ public function transfer(UserPolicyInterface $authUser, Deal $deal) { if ($authUser->is($this->model->owner())) { return true; } if ($authUser->canDo('deal.deal.action.transfer')) { return true; } return false; } /** * Determine if the given user can approve the given deal. * * @param UserPolicyInterface $authUser * * @return bool */ public function delete(UserPolicyInterface $authUser, Deal $deal) { if ($authUser->canDo('deal.deal.action.delete')) { return true; } return false; } }