1.2.x -> 1.4.x upgrade permissions

Created by Alex Harrington
Keywords:
permissions grant everyone

The upgrade from 1.2 to 1.4 series changes the permissions system in Xibo and there is no direct mapping from the old system to the new one, so on upgrade users won't be able to see layouts and media they didn't create.

If you want a quick way to grant everyone access to everything, take a database upgrade, then run the following SQL statements:

INSERT INTO lkcampaigngroup (CampaignID, GroupID, View, Edit, Del)
SELECT DISTINCT MediaID, GroupID, 1, 1, 1
FROM `campaign`
CROSS JOIN `group`
WHERE group.IsEveryone = 1;

INSERT INTO lkmediagroup (MediaID, GroupID, View, Edit, Del)
SELECT DISTINCT MediaID, GroupID, 1, 1, 1
FROM `media`
CROSS JOIN `group`
WHERE group.IsEveryone = 1;

INSERT INTO lklayoutregiongroup (LayoutID, RegionID, GroupID, View, Edit, Del)
SELECT DISTINCT layoutid, regionid, GroupID, 1, 1, 1
FROM `lklayoutmedia`
CROSS JOIN `group`
WHERE group.IsEveryone = 1;

INSERT INTO lklayoutmediagroup (MediaID, LayoutID, RegionID, GroupID, View, Edit, Del)
SELECT DISTINCT MediaID, layoutid, regionid, GroupID, 1, 1, 1
FROM `lklayoutmedia`
CROSS JOIN `group`
WHERE group.IsEveryone = 1;

Then make sure in Settings under default you have Media Default and Layout Default set to "Public".