canDo('example.example.approve')) { return true; } return false; } /** * Determine if the given user can approve the given example. * * @param UserPolicyInterface $authUser * * @return bool */ public function submit(UserPolicyInterface $authUser, Example $example) { if ($authUser->canDo('example.example.submit')) { return true; } return false; } /** * Determine if the given user can approve the given example. * * @param UserPolicyInterface $authUser * * @return bool */ public function publish(UserPolicyInterface $authUser, Example $example) { if ($authUser->canDo('example.example.publish')) { return true; } return false; } /** * Determine if the given user can approve the given example. * * @param UserPolicyInterface $authUser * * @return bool */ public function unpublish(UserPolicyInterface $authUser, Example $example) { if ($authUser->canDo('example.example.unpublish')) { return true; } return false; } /** * Determine if the given user can approve the given example. * * @param UserPolicyInterface $authUser * * @return bool */ public function archive(UserPolicyInterface $authUser, Example $example) { if ($authUser->canDo('example.example.archive')) { return true; } return false; } /** * Determine if the given user can approve the given example. * * @param UserPolicyInterface $authUser * * @return bool */ public function unarchive(UserPolicyInterface $authUser, Example $example) { if ($authUser->canDo('example.example.unarchive')) { return true; } return false; } /** * Determine if the given user can approve the given example. * * @param UserPolicyInterface $authUser * * @return bool */ public function reject(UserPolicyInterface $authUser, Example $example) { if ($authUser->canDo('example.example.reject')) { return true; } return false; } }