MySQL: Preventing deleting...
#1
I have my kodi data stored in a mysql database. That's great for machines I trust, but the main family TV is pretty much fair game. I'd like to make it so that no one can make any changes to shares, add new media, delete new media (including if a movie gets clicked on that no longer exists, that the dialog that offers to delete from the library, doesn't appear).

Wondering if this is something I can do, and if so, from where? The profiles, DB backend, etc?
Reply
#2
You could make a read-only user for MySQL for those machines. Maybe. I've never tried it myself, and I don't know what Kodi would do in that situation, but I don't think it would hurt to try.
Reply
#3
I use a MySQL setup and I only added the library in one on computer. None of the others can add or delete from the library because they don't have direct access to the files.
Reply
#4
(2016-04-26, 16:09)higginss Wrote: I use a MySQL setup and I only added the library in one on computer. None of the others can add or delete from the library because they don't have direct access to the files.
I'm guessing you mean you originally only added file locations set content and scanned on 1 machine. If you're using mysql then whether you add the files in sources.xml is irrelevant. The file locations are stored in the mysql database, so you can still update / clean the library from any connected machine.
Unless you've done something different, in which case it would be useful to describe it.
Reply
#5
Thanks for the replies...

I scan my libraries from a single machine that has RW access to the network share.

I have set a read-only mysql user in advancedsettings.xml on the Pis that connect to each TV. Starting lately, kodi is hanging on various sql commands that fail due to th DB readonly perms.

So I wanted to give the DB user ReadWrite... but I don't want anyone to be able to remove a movie or tv episode from the library.

So, should I use a settings file to prevent that, or try to figure out which tables on the DB need to be protected?
Reply
#6
Kiosk mode might be worth considering - I've not used it for years (probably on an xbox last time!) but IIRC it takes away options to change things via the context menu / sidebar.
Reply
#7
Wait, I think I figured it out... looks like when I setup a new profile, I can set delete/mdifying to be disabled. That should solve this, I think.
Reply
#8
(2016-04-26, 23:29)john_es Wrote: Wait, I think I figured it out... looks like when I setup a new profile, I can set delete/mdifying to be disabled. That should solve this, I think.

Not quite. That only works when you are using the default, local SQLite database. Profiles will require advancedsettings.xml files, so they will be accessing the database the same as any other profile.
Reply
#9
I've got 7 systems running Kodi. 4 of those systems are used by my kids and I didn't want them doing any deletions or updates to the db, setting items as watched, etc. So here's what I do....

All systems have an advancedsettings.xml pointing to the MySQL databases
There are 2 different users in MySQL - xbmc & xbmc2
xbmc has full rights and is the user set in the advancedsettings.xml on the systems I use.
xbmc2 has limited rights in MySQL and is the user set in the advancedsettings.xml on the kids systems
The rights set for xbmc2 in MySQL are only SELECT and CREATE TEMPORARY TABLES

Hope this helps.
Reply
#10
(2016-04-27, 04:13)Ned Scott Wrote:
(2016-04-26, 23:29)john_es Wrote: Wait, I think I figured it out... looks like when I setup a new profile, I can set delete/mdifying to be disabled. That should solve this, I think.

Not quite. That only works when you are using the default, local SQLite database. Profiles will require advancedsettings.xml files, so they will be accessing the database the same as any other profile.

Kind of, right?

What I mean is that yes, the user would connect via myql database with advancedsettings and that DB user would have full rights to the table. But from the UI standpoint, with the limited profile, there's no option to remove anything from the database. Effectively they cannot modify the library which is what I want.
Reply
#11
I believe Kodi will still prompt for removal if it didn't find a file, though. Profiles can still be used to remove/limit various things, though. I would still go with what Aenima99x suggests (or both).
Reply
#12
(2016-04-27, 16:49)Aenima99x Wrote: I've got 7 systems running Kodi. 4 of those systems are used by my kids and I didn't want them doing any deletions or updates to the db, setting items as watched, etc. So here's what I do....

All systems have an advancedsettings.xml pointing to the MySQL databases
There are 2 different users in MySQL - xbmc & xbmc2
xbmc has full rights and is the user set in the advancedsettings.xml on the systems I use.
xbmc2 has limited rights in MySQL and is the user set in the advancedsettings.xml on the kids systems
The rights set for xbmc2 in MySQL are only SELECT and CREATE TEMPORARY TABLES

Hope this helps.

This is how I originally had it, but I want the user to be able to have updated watch lists/counts, bookmarks, etc. I just don't want them to be able to delete / remove stuff. So I am trying to figure out which tables I need to give read/write access to and which ones can be rad only Kind of surprised that this isnt on the wiki, or maybe I am searching incorrectly.
Reply

Logout Mark Read Team Forum Stats Members Help
MySQL: Preventing deleting...0