Security around Playlists

Hey all, it’s been a minute since I have posted. I hope things are well.

I’m trying to understand the playlist functionality in Kaltura Server. I have a potential requirement to implement user specific and “public” playlists in my Kaltura API app. I’d like to use the Kaltura Playlist functionality, but I’m unsure of a few things. (in this context “public” means available to all my applications users)

My main question is; Are Kaltura playlists owned by a specific user such that they can only “see” their playlists? It seems that the answer is no. Playlists are sort of a “global” thing in Kaltura.

If they can be user specific, how could one implement them in Kaltura? If it’s in the documentation, I’m just not seeing it and I just need to be pointed in the right direction.

This is against best practice, I know, but currently my API application uses an admin login to interact with Kaltura. I’d need to change this substantially if I was all of a sudden going to have user specific content on the platform. The documentation seems pretty clear on this, though I could use some clarification on user creation on the base platform vs user creation in KMC. They’re clearly not the same thing.

I hope this is a sufficient explanation on what I’m looking for. Thank you!

Hi @david.hahn1,

Playlists are implemented as entries of type 5 [KalturaEntryType::PLAYLIST]. Each such entry has a TXT file on disk which contains a comma separated list of the entry IDs it consists of.
The ownership behaviour is the same as with all other entry types. They are all associated with a specific partner ID.
To illustrate, here is an example from my own local ENV where 0_2cdigqq9 is the playlist ID:

mysql> select id, type, data,partner_id, name, kuser_id, puser_id, custom_data from entry where id='0_2cdigqq9'\G
*************************** 1. row ***************************
         id: 0_2cdigqq9
       type: 5
       data: 100022.txt
 partner_id: 101
       name: mbp
   kuser_id: 9
   puser_id: jess@kaltura.com
custom_data: a:4:{s:14:"creatorKuserId";i:34;s:14:"creatorPuserId";N;s:12:"thumb_offset";i:3;s:16:"partnerSortValue";i:0;}

You can get the path to the TXT file with the entries 0_2cdigqq9 consists of with this query:

mysql> select concat(file_root,file_path) from file_sync where object_id='0_2cdigqq9' and version=100022;
+----------------------------------------------------------------+
| concat(file_root,file_path)                                    |
+----------------------------------------------------------------+
| /opt/kaltura/web/content/entry/data/0/0/0_2cdigqq9_100022.txt |
+----------------------------------------------------------------+

Here is what this file looks like:

# cat /opt/kaltura/web//content/entry/data/0/0/0_2cdigqq9_100022.txt
0_r33013ur,0_db5gooxw,0_6d76lcve

As you can understand from the above, when making changes to the playlist, the old version is still kept so there may be older txt files present as well, for example, on my ENV:

# ls -alrt /opt/kaltura/web//content/entry/data/0/0/0_2cdigqq9*
-rw-r----- 1 www-data kaltura   0 Nov 22  2017 /opt/kaltura/web//content/entry/data/0/0/0_2cdigqq9_100002.txt
-rw-r----- 1 www-data kaltura  10 Nov 22  2017 /opt/kaltura/web//content/entry/data/0/0/0_2cdigqq9_100012.txt
-rw-r----- 1 www-data www-data 32 Aug 19 18:55 /opt/kaltura/web//content/entry/data/0/0/0_2cdigqq9_100022.txt

You can tell that 100022.txt is the current one because of the value in entry.data.

It is worth noting that there are two kinds of playlists that Kaltura supports: manual and rule based. Manual playlists allow you to pre-define a static list of entries, whereas Rule Based playlists are dynamic, and will update automatically based on what is currently available in your media library and the rules that define the playlist.

In terms of the API, the playlist service can be used to manipulate playlist objects. See:
https://developer.kaltura.com/api-docs/service/playlist

Regarding the relationship between partners and users, please see:

As for content entitlements, I believe you’ll find this article to be a good starting point:
https://developer.kaltura.com/api-docs/Secure_Control_and_Govern/Content-Entitlements-Privacy-Enforcement.html

Hope this helps,

Thanks for all the information Jess. I will review and post back if I have more questions :).

Thanks again -Dave