Improved alert notifications.

This commit is contained in:
DebaucheryLibrarian
2021-04-22 19:44:23 +02:00
parent 95f3b1c03a
commit c5e74c33b7
9 changed files with 266 additions and 24 deletions

View File

@@ -1567,6 +1567,13 @@ exports.up = knex => Promise.resolve()
WHERE alerts.id = alerts_stashes.alert_id
AND alerts.user_id = current_user_id()
));
ALTER TABLE notifications ENABLE ROW LEVEL SECURITY;
CREATE POLICY notifications_policy_select ON notifications FOR SELECT USING (notifications.user_id = current_user_id());
CREATE POLICY notifications_policy_update ON notifications FOR UPDATE USING (notifications.user_id = current_user_id());
CREATE POLICY notifications_policy_delete ON notifications FOR DELETE USING (notifications.user_id = current_user_id());
CREATE POLICY notifications_policy_insert ON notifications FOR INSERT WITH CHECK (true);
`, {
visitor: knex.raw(config.database.query.user),
});