From 3c8d18afc4f5a65451cc646d4e6f72cb3c2d6287 Mon Sep 17 00:00:00 2001 From: Nathan Coad Date: Tue, 9 Jan 2024 16:17:36 +1100 Subject: [PATCH] try something else --- models/secret.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/models/secret.go b/models/secret.go index 0cf104e..7f64992 100644 --- a/models/secret.go +++ b/models/secret.go @@ -72,7 +72,7 @@ func SecretsGetAllowed(s *Secret, userId int) ([]UserSecret, error) { // Query for group access queryArgs := []interface{}{} - query := `SELECT users.UserId, users.GroupId, permissions.ReadOnly, safes.SafeName, secrets.* + query := `SELECT * FROM users INNER JOIN groups ON users.GroupId = groups.GroupId INNER JOIN permissions ON groups.GroupId = permissions.GroupId @@ -126,7 +126,7 @@ func SecretsGetAllowed(s *Secret, userId int) ([]UserSecret, error) { */ // Execute the query - log.Printf("SecretsGetAllowedForGroup query string : '%s'\n%+v\n", query, queryArgs) + log.Printf("SecretsGetAllowedForGroup query string : '%s'\nArguments: %+v\n", query, queryArgs) rows, err := db.Queryx(query, queryArgs...) if err != nil {