canDo('tm.131414.view') && $user->isAdmin()) { return true; } return $131414->user_id == user_id() && $131414->user_type == user_type(); } /** * Determine if the given user can create a 131414. * * @param UserPolicy $user * @param 131414 $131414 * * @return bool */ public function create(UserPolicy $user) { return $user->canDo('tm.131414.create'); } /** * Determine if the given user can update the given 131414. * * @param UserPolicy $user * @param 131414 $131414 * * @return bool */ public function update(UserPolicy $user, 131414 $131414) { if ($user->canDo('tm.131414.edit') && $user->isAdmin()) { return true; } return $131414->user_id == user_id() && $131414->user_type == user_type(); } /** * Determine if the given user can delete the given 131414. * * @param UserPolicy $user * @param 131414 $131414 * * @return bool */ public function destroy(UserPolicy $user, 131414 $131414) { return $131414->user_id == user_id() && $131414->user_type == user_type(); } /** * Determine if the given user can verify the given 131414. * * @param UserPolicy $user * @param 131414 $131414 * * @return bool */ public function verify(UserPolicy $user, 131414 $131414) { if ($user->canDo('tm.131414.verify')) { return true; } return false; } /** * Determine if the given user can approve the given 131414. * * @param UserPolicy $user * @param 131414 $131414 * * @return bool */ public function approve(UserPolicy $user, 131414 $131414) { if ($user->canDo('tm.131414.approve')) { return true; } return false; } /** * Determine if the user can perform a given action ve. * * @param [type] $user [description] * @param [type] $ability [description] * * @return [type] [description] */ public function before($user, $ability) { if ($user->isSuperuser()) { return true; } } }