fix bug with auth and query

This commit is contained in:
GotPPay
2018-05-01 00:24:50 +02:00
parent bc6bfdec46
commit c43ae352a3
2 changed files with 3 additions and 3 deletions

View File

@@ -784,7 +784,7 @@ func (c *userRepo) getAddressSecondaryData(address entity.Address) (entity.Addre
// GetAll returns a list of all active cards
func (c *userRepo) GetAll() (list []entity.User, err error) {
return c.parseSet(c.conn.Query(c.getQuery() + " WHERE a.active = 1 "))
return c.parseSet(c.conn.Query(c.getQuery() + " AND a.active = 1 "))
}
// GetByID returns a single card data by its ID

View File

@@ -117,8 +117,8 @@ func (a *Config) policyObjectAttributes(c echo.Context, userDetails viewmodel.Us
objectIsNew := len(c.ParamValues()) <= 1
objectIsExisting := len(c.ParamValues()) > 1
existingUser := strings.Contains(c.Request().URL.Path, "/users") && objectIsNew
newUser := strings.Contains(c.Request().URL.Path, "/users") && objectIsExisting
existingUser := strings.Contains(c.Request().URL.Path, "/users") && objectIsExisting
newUser := strings.Contains(c.Request().URL.Path, "/users") && objectIsNew
existingOrganization := strings.Contains(c.Request().URL.Path, "/organization") && objectIsExisting
newOrganization := strings.Contains(c.Request().URL.Path, "/organization") && objectIsNew