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