From b770919663bbcfa757421910641e75bf6cf06f8d Mon Sep 17 00:00:00 2001 From: valentinkolb Date: Thu, 28 Mar 2024 14:37:18 +0100 Subject: [PATCH] fix(ldapSync.tables): fixed api rules --- ldapSync/tables.go | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/ldapSync/tables.go b/ldapSync/tables.go index 06e14ad..d3e417e 100644 --- a/ldapSync/tables.go +++ b/ldapSync/tables.go @@ -114,13 +114,13 @@ func createLDAPUsersTable(app *pocketbase.PocketBase) error { // create form for collection creation form := forms.NewCollectionUpsert(app, collection) - form.Name = ldapUsersTableName // collection name - form.Type = models.CollectionTypeAuth // collection type set to auth, otherwise login will not work - form.ListRule = types.Pointer("@request.auth.id != id") // list rule (only user self can list their own data - form.ViewRule = types.Pointer("@request.auth.id != id") // view rule (only user self can view their own data) - form.CreateRule = nil // create rule (anyone can create) - form.UpdateRule = nil // update rule (anyone can update) - form.DeleteRule = nil // delete rule (anyone can delete) + form.Name = ldapUsersTableName // collection name + form.Type = models.CollectionTypeAuth // collection type set to auth, otherwise login will not work + form.ListRule = types.Pointer("@request.auth.id = id") // list rule (only user self can list their own data + form.ViewRule = types.Pointer("@request.auth.id = id") // view rule (only user self can view their own data) + form.CreateRule = nil // create rule (anyone can create) + form.UpdateRule = nil // update rule (anyone can update) + form.DeleteRule = nil // delete rule (anyone can delete) // add common name field, the collection will also have a field named "username" which is the username field. this field is added automatically by the forms.NewCollectionUpsert() function form.Schema.AddField(&schema.SchemaField{