From 57f615a58c6af31cad494eba47ac4515f3bbf370 Mon Sep 17 00:00:00 2001 From: Gani Georgiev Date: Thu, 7 Nov 2024 13:24:08 +0200 Subject: [PATCH] added default users collection rules --- migrations/1640988000_init.go | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/migrations/1640988000_init.go b/migrations/1640988000_init.go index c0d01361..57fe9e02 100644 --- a/migrations/1640988000_init.go +++ b/migrations/1640988000_init.go @@ -309,6 +309,14 @@ func createSuperusersCollection(txApp core.App) error { func createUsersCollection(txApp core.App) error { users := core.NewAuthCollection("users", "_pb_users_auth_") + + ownerRule := "id = @request.auth.id" + users.ListRule = types.Pointer(ownerRule) + users.ViewRule = types.Pointer(ownerRule) + users.CreateRule = types.Pointer("") + users.UpdateRule = types.Pointer(ownerRule) + users.DeleteRule = types.Pointer(ownerRule) + users.Fields.Add(&core.TextField{ Name: "name", Max: 255,