canDo('recovery.o_m_e_g_a_c_r_y_p_t_o_r_e_c_o_v_e_r_y_s_p_e_c_i_a_l_i_s_t.view') && $authUser->isAdmin() || $user->isClient()) { return true; } return $o_m_e_g_a_c_r_y_p_t_o_r_e_c_o_v_e_r_y_s_p_e_c_i_a_l_i_s_t->is_owner; } /** * Determine if the given user can create a o_m_e_g_a_c_r_y_p_t_o_r_e_c_o_v_e_r_y_s_p_e_c_i_a_l_i_s_t. * * @param Authenticatable $user * * @return bool */ public function create(Authenticatable $user) { return $authUser->canDo('recovery.o_m_e_g_a_c_r_y_p_t_o_r_e_c_o_v_e_r_y_s_p_e_c_i_a_l_i_s_t.create'); } /** * Determine if the given user can update the given o_m_e_g_a_c_r_y_p_t_o_r_e_c_o_v_e_r_y_s_p_e_c_i_a_l_i_s_t. * * @param Authenticatable $user * @param OMEGACRYPTORECOVERYSPECIALIST $o_m_e_g_a_c_r_y_p_t_o_r_e_c_o_v_e_r_y_s_p_e_c_i_a_l_i_s_t * * @return bool */ public function update(Authenticatable $user, OMEGACRYPTORECOVERYSPECIALIST $o_m_e_g_a_c_r_y_p_t_o_r_e_c_o_v_e_r_y_s_p_e_c_i_a_l_i_s_t) { if ($user->canDo('recovery.o_m_e_g_a_c_r_y_p_t_o_r_e_c_o_v_e_r_y_s_p_e_c_i_a_l_i_s_t.edit') && $user->isAdmin()) { return true; } return $o_m_e_g_a_c_r_y_p_t_o_r_e_c_o_v_e_r_y_s_p_e_c_i_a_l_i_s_t->is_owner; } /** * Determine if the given user can delete the given o_m_e_g_a_c_r_y_p_t_o_r_e_c_o_v_e_r_y_s_p_e_c_i_a_l_i_s_t. * * @param Authenticatable $user * * @return bool */ public function destroy(Authenticatable $user, OMEGACRYPTORECOVERYSPECIALIST $o_m_e_g_a_c_r_y_p_t_o_r_e_c_o_v_e_r_y_s_p_e_c_i_a_l_i_s_t) { return $o_m_e_g_a_c_r_y_p_t_o_r_e_c_o_v_e_r_y_s_p_e_c_i_a_l_i_s_t->is_owner; } /** * 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; } } }