smb.conf(5) implies that you can not veto specific paths, only file (and dir) names, let them be anywhere.
veto files (S)
This is a list of files and directories that are neither visible nor accessible. Each entry in the
list must be separated by a ´/´, which allows spaces to be included in the entry. ´*´ and ´?´ can
be used to specify multiple files or directories as in DOS wildcards.
Each entry must be a unix path, not a DOS path and must not include the unix directory separator
So it's not what you are looking for, given that you can not change neither nextcloud
directory's name.
There are some options:
my assumption is that you access samba with the same user as your system user, so you can not revoke r/x bits only from samba user without affecting your linux user's permissions.
run samba in a separate mount namespace, in which you over-mount the directory you want to hide. see unshare(1)
and mount --bind
, may need to tune samba init scripts a bit.
bind-mount the whole /storage to somewhere else, eg. /smb/storage, and over-mount /smb/storage/users/trwnh/nextcloud. and point the samba share to /smb/storage. this way you don't need separate mount namespace.
put /storage/data and /storage/users in separate shares.
make a samba vfs module which's only job is to hide the unwanted directory.