|
|
|
@ -17,11 +17,11 @@ class RemoveAdminNewsHtmlPrivilege extends Migration
|
|
|
|
|
|
|
|
|
|
$connection = $this->schema->getConnection();
|
|
|
|
|
|
|
|
|
|
// Delete unused privileges
|
|
|
|
|
$connection->delete('
|
|
|
|
|
DELETE FROM `Privileges`
|
|
|
|
|
WHERE `name` = \'admin_news_html\'
|
|
|
|
|
');
|
|
|
|
|
// Delete unused privilege
|
|
|
|
|
$connection->delete(
|
|
|
|
|
'DELETE FROM `Privileges` WHERE `name` = ?',
|
|
|
|
|
['admin_news_html']
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
@ -33,9 +33,19 @@ class RemoveAdminNewsHtmlPrivilege extends Migration
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
$connection->insert('
|
|
|
|
|
INSERT INTO `Privileges` (`name`, `desc`)
|
|
|
|
|
VALUES (\'admin_news_html\', \'Use HTML in news\')
|
|
|
|
|
');
|
|
|
|
|
$connection = $this->schema->getConnection();
|
|
|
|
|
$connection->insert(
|
|
|
|
|
'INSERT INTO `Privileges` (`name`, `desc`) VALUES (?, ?)',
|
|
|
|
|
['admin_news_html', 'Use HTML in news']
|
|
|
|
|
);
|
|
|
|
|
|
|
|
|
|
// Add permissions to news admins to edit html news
|
|
|
|
|
$connection->insert(
|
|
|
|
|
'
|
|
|
|
|
INSERT IGNORE INTO GroupPrivileges (group_id, privilege_id)
|
|
|
|
|
VALUES ((SELECT UID FROM `Groups` WHERE `name` = ?), (SELECT id FROM `Privileges` WHERE `name` = ?))
|
|
|
|
|
',
|
|
|
|
|
['News Admin', 'admin_news_html']
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|