add Permission to struct
All checks were successful
continuous-integration/drone/push Build is passing
All checks were successful
continuous-integration/drone/push Build is passing
This commit is contained in:
@@ -210,25 +210,15 @@ func UpdateSecret(c *gin.Context) {
|
|||||||
}
|
}
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/*
|
// Get userId that we stored in the context earlier
|
||||||
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")
|
|
||||||
|
|
||||||
if val, ok := c.Get("user-id"); !ok {
|
if val, ok := c.Get("user-id"); !ok {
|
||||||
c.JSON(http.StatusBadRequest, gin.H{"error": "error determining user"})
|
c.JSON(http.StatusBadRequest, gin.H{"error": "error determining user"})
|
||||||
return
|
return
|
||||||
} else {
|
} else {
|
||||||
user_id = val.(int)
|
user_id = val.(int)
|
||||||
|
//log.Printf("user_id: %v\n", user_id)
|
||||||
}
|
}
|
||||||
|
|
||||||
log.Printf("user_id: %v\n", user_id)
|
|
||||||
|
|
||||||
// Populate fields
|
// Populate fields
|
||||||
s := models.Secret{}
|
s := models.Secret{}
|
||||||
|
|
||||||
|
@@ -28,6 +28,7 @@ type Secret struct {
|
|||||||
type UserSecret struct {
|
type UserSecret struct {
|
||||||
User
|
User
|
||||||
Group
|
Group
|
||||||
|
Permission
|
||||||
Secret
|
Secret
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user