support querying for secret with username
This commit is contained in:
@@ -12,6 +12,7 @@ import (
|
||||
type RetrieveInput struct {
|
||||
DeviceName string `json:"deviceName"`
|
||||
DeviceCategory string `json:"deviceCategory"`
|
||||
UserName string `json:"userName"`
|
||||
}
|
||||
|
||||
type ListSecret struct {
|
||||
@@ -46,6 +47,7 @@ func RetrieveSecret(c *gin.Context) {
|
||||
s.RoleId = u.RoleId
|
||||
s.DeviceName = input.DeviceName
|
||||
s.DeviceCategory = input.DeviceCategory
|
||||
s.UserName = input.UserName
|
||||
|
||||
// Don't apply a role filter if user has admin role
|
||||
results, err = models.GetSecrets(&s, u.Admin)
|
||||
|
Reference in New Issue
Block a user