How to correctly allow Kodi users access to Nextcloud data folder

Ubuntu 18.04
Snap Nextcloud 22
Kodi media center
Thinlinc server

Currently I have users added to root group in order to access the media files with Kodi.

What I have done so far.

Grant Root Privileges to user kodi
sudo usermod -aG sudo kodi

Add kodi to root group
sudo usermod -G root kodi

Verify New User
su - kodi
grep ‘^sudo’ /etc/group
Result should be.
sudo:x:27:kodi

Allow access to nextcloud folder currently is 750 owned by root.
sudo chmod 770 /var/snap/nextcloud/common/nextcloud

Allow access to nextcloud folder currently is 755 owned by root.
sudo chmod 775 /var/snap/nextcloud

Is there a better way to do this?

My nextcloud has user www-data. No root on anything. If your user is in sudo group they should have no need for root.

Be sure to read admin documentation.
https://docs.nextcloud.com/server/latest/admin_manual/contents.html

You can also expose your local storage multiple ways, but root is not necessary. Consider setting up Samba or NFS to share between the services in a simple and sane manner.

Thanks for the reply.
I will try a read only Samba share next, Kodi has the option to connect.
I installed Nextcloud via snap, you only have root in the file system.

I Don’t understand the need of a user kodi. any user can start kodi on any computer/phone/tablet anywhere in the world and still get your data from the cloud.

Kodi accepts webdav.
Add Video
Browse
add Networklocation

add share WebDav-server [https]
server cloud.example.com
browse
remote Location: remote.php/webdav/Folder Where Folder is your directory in your users cloud space
port 443
username UserName
password Password

I ended up with a read only share on the nextcloud data folder because the more than 1 user with music.