add Permission to struct
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
2024-01-09 11:53:38 +11:00
parent 3186fe9ebc
commit 1c3d82ffba
2 changed files with 3 additions and 12 deletions

View File

@@ -210,25 +210,15 @@ func UpdateSecret(c *gin.Context) {
}
*/
/*
user_id, err := token.ExtractTokenID(c)
if err != nil {
c.JSON(http.StatusBadRequest, gin.H{"error": "error determining user"})
return
}
*/
log.Printf("c.Keys: %v\n", c.Keys)
//user_id := c.GetInt("user-id")
// Get userId that we stored in the context earlier
if val, ok := c.Get("user-id"); !ok {
c.JSON(http.StatusBadRequest, gin.H{"error": "error determining user"})
return
} else {
user_id = val.(int)
//log.Printf("user_id: %v\n", user_id)
}
log.Printf("user_id: %v\n", user_id)
// Populate fields
s := models.Secret{}

View File

@@ -28,6 +28,7 @@ type Secret struct {
type UserSecret struct {
User
Group
Permission
Secret
}