Hide WooCommerce products from guests, restrict specific products to wholesale user roles, and redirect unauthorised users away from checkout using WordPress capability checks.
Incorrect file permissions are a common cause of WordPress errors like “Could not create directory” or “File is not writable” — and overly permissive settings (like 777 on files) are a serious security risk. The standard WordPress recommendation is 755 for directories and 644 for files.