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.

The read only share stopped working.

I now have setup a test server with a second HDD mounted in the Home folder of the server.
You use the desktop client on the server to mirror the data to the spare drive then Plex and Kodi seem to work well, no configuring like I had to do last time.

I have a $5/month Virtual server setup like this to test as well. I can edit files remotely and have many clients sync and work on the shared data. You can also SSH into the server and dump data in it and just wait for it to sync up.

I uploaded video and pic footage at another place then traveled home to sync the data to make a DVD iso with my Linux and Windows PC’s.
I also used the Virtual server to process ffmpeg draft outputs when I was onsite. It was very slow because it was a 1 core CPU, 1 GB Ram.

I did not take any computer hardware with me to the party.

Backup options.
If the server dies at least you have a copy of the data on another platter and remotely in as many places as you like.? I have run 5 clients to the same user account in the past using a mix of windows and Linux clients but never remotely.

Hope that makes sense, happy to answer questions.