Files
checkcle/server/pb_migrations/1772125544_updated_alert_configurations.js
Tola Leng f2c338ced9 fix(security): enforce API authentication rules on collection (#214)
- Add authentication and authorization rules to prevent unauthorized access via REST API endpoints.
2026-02-27 00:17:45 +07:00

29 lines
731 B
JavaScript

/// <reference path="../pb_data/types.d.ts" />
migrate((app) => {
const collection = app.findCollectionByNameOrId("pbc_1938176441")
// update collection data
unmarshal({
"createRule": "@request.auth.id != \"\"",
"deleteRule": "@request.auth.id != \"\"",
"listRule": "@request.auth.id != \"\"",
"updateRule": "@request.auth.id != \"\"",
"viewRule": "@request.auth.id != \"\""
}, collection)
return app.save(collection)
}, (app) => {
const collection = app.findCollectionByNameOrId("pbc_1938176441")
// update collection data
unmarshal({
"createRule": "",
"deleteRule": "",
"listRule": "",
"updateRule": "",
"viewRule": ""
}, collection)
return app.save(collection)
})