Various fixes to data access

This commit is contained in:
Torkel Ödegaard
2015-01-20 15:23:14 +01:00
parent 0a695ba17a
commit 4ea5d80099
8 changed files with 27 additions and 8 deletions
+1 -1
View File
@@ -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
View File
@@ -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
}