Various fixes to data access
This commit is contained in:
+1
-1
@@ -17,7 +17,7 @@ func Search(c *middleware.Context) {
|
||||
}
|
||||
|
||||
if strings.HasPrefix(queryText, "tags!:") {
|
||||
query := m.GetDashboardTagsQuery{}
|
||||
query := m.GetDashboardTagsQuery{AccountId: c.AccountId}
|
||||
err := bus.Dispatch(&query)
|
||||
if err != nil {
|
||||
c.JsonApiErr(500, "Failed to get tags from database", err)
|
||||
|
||||
+1
-1
@@ -67,7 +67,7 @@ func validateUsingAccount(userId int64, accountId int64) bool {
|
||||
func SetUsingAccount(c *middleware.Context) {
|
||||
usingAccountId := c.ParamsInt64(":id")
|
||||
|
||||
if !validateUsingAccount(c.AccountId, usingAccountId) {
|
||||
if !validateUsingAccount(c.UserId, usingAccountId) {
|
||||
c.JsonApiErr(401, "Not a valid account", nil)
|
||||
return
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user