work on read-only restrictions
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:
@@ -93,15 +93,6 @@ func StoreSecret(c *gin.Context) {
|
||||
s.DeviceName = input.DeviceName
|
||||
s.DeviceCategory = input.DeviceCategory
|
||||
|
||||
// Query which safes the current user is allowed to access
|
||||
/*
|
||||
user_id, err := token.ExtractTokenID(c)
|
||||
if err != nil {
|
||||
c.JSON(http.StatusBadRequest, gin.H{"error": "error determining user"})
|
||||
return
|
||||
}
|
||||
*/
|
||||
|
||||
// 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"})
|
||||
@@ -111,7 +102,7 @@ func StoreSecret(c *gin.Context) {
|
||||
//log.Printf("user_id: %v\n", user_id)
|
||||
}
|
||||
|
||||
// TODO replace FindSafeId with models.SecretsGetAllowed()
|
||||
// TODO determine whether this access is readonly or not
|
||||
|
||||
safeId, err := CheckSafeAllowed(UserId, input)
|
||||
if err != nil {
|
||||
|
Reference in New Issue
Block a user