VaasCore

  • Ecto
  • General design pattern
  • Authentication
  • Testing
  • Business logic
  • structure.sql (important for tests!), two ways to

Shared resources between organisations

Every Organisation has its own resources: Channels, Shows, Productions, Playlists, etc. These resources are all isolated per Organisation. This means that an ApiUser or VmsUser for Organisation A cannot access the resources of Organisation B. However, through the VMS, two types of resources are eligible for sharing, Channels and Playlists.

When a VmsUser of Organisation A visits the Channel or Playlist tab in the VMS, she will see lock icons next to the items they own. Clicking on these makes resource sharing possible. The VmsUser can then give access to a resource by selecting the Organisation they want to grant access to the resource to from a dropdown. This access is read-only, ie. the Organisation that receives access to this resource can only see it in the VMS, API and VaaS, but not edit its metadata. They can use it however to add a Production from another Organisation into a Playlist they themselves own.

Shared Playlists

A shared Playlist can be used in a PlaylistCollection, and thus appear on the wall of the Organisation the Playlist is shared with. This Organisation cannot add or remove any entries from the Playlist, and when the Playlist is updated by its owner, the Playlist will also change for the Organisation it's shared with (as it's the same record in the database).

Shared Channels

Channels are shared between organisations in order to access Shows and Productions that belong to this Channel. As with Playlists, the sharing relation is read-only, meaning the metadata of a Channel, Show or Production cannot be changed by the Organisation it is shared with, only by the original owner. When the original owner changes anything in these resources, this change is also reflected in the content of the Organisation it's shared with (as it's all the same record in the database).

Currently there's not a more fine grained way of sharing content. If an Organisation wants to have access to all Productions of a certain Show, they require access to the Channel it belongs to, and thus to all other Shows and Productions that belong to that Channel.

Technical implementation

There are two join tables, channel_permissions and playlist_permissions, which join the organisation_id and the channel_id or playlist_id respectively. Whenever a new Channel or Playlist is created, a record in one of the join tables is created as well, which contains the organisation_id the VmsUser creating the Channel or Playlist belongs to, and the id of the newly created object. A new record is added whenever a VmsUser grants readonly access to another Organisation.

Which Organisations a VmsUser can grant access to, is regulated via the available_accessible_organisations table. Entries to this table should be made manually. This feature exists so a VmsUser can't share content with random Organisations that also happen to use the VMS, but only Organisation it should be able to share its content with.

The channel_permissions and playlist_permissions records should always be used while fetching other records, like Shows and Productions. The VaasCore.AccessibleContent module should handle most of this. When Productions or Shows are fetched, they are fetched using either of these join tables, in order to prevent the wrong content showing up on their pages.

Last Updated: 3/19/2019, 3:11:27 PM