1
0
mirror of https://github.com/pocketbase/pocketbase.git synced 2025-01-24 14:26:58 +02:00

added default users collection rules

This commit is contained in:
Gani Georgiev 2024-11-07 13:24:08 +02:00
parent 1bd0baf328
commit 57f615a58c

View File

@ -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,