Commit bd8aa8c7 authored by zauberstuhl's avatar zauberstuhl

Change CurrentUser parameter

related to ganggo@b92e6515
parent 563eba03
......@@ -88,7 +88,7 @@ func (a ApiAspect) ShowPerson() revel.Result {
)
a.Params.Bind(&personID, "id")
user, err := models.CurrentUser(a.Params, a.Session)
user, err := models.CurrentUser(a.Controller)
if err != nil {
a.Log.Error(TAG, "db", err, "api", ERR_UNAUTHORIZED)
return a.ApiError(http.StatusUnauthorized, ERR_UNAUTHORIZED)
......@@ -216,7 +216,7 @@ func (a ApiAspect) DeletePerson() revel.Result {
}
func (a ApiAspect) Index(fields string) revel.Result {
user, err := models.CurrentUser(a.Params, a.Session)
user, err := models.CurrentUser(a.Controller)
if err != nil {
a.Log.Error(TAG, "db", err, "api", ERR_UNAUTHORIZED)
return a.ApiError(http.StatusUnauthorized, ERR_UNAUTHORIZED)
......@@ -283,7 +283,7 @@ func (a ApiAspect) Create() revel.Result {
return a.ApiError(http.StatusBadRequest, ERR_EMPTY_STRING)
}
user, err := models.CurrentUser(a.Params, a.Session)
user, err := models.CurrentUser(a.Controller)
if err != nil {
a.Log.Error(TAG, "db", err, "api", ERR_UNAUTHORIZED)
return a.ApiError(http.StatusUnauthorized, ERR_UNAUTHORIZED)
......
......@@ -144,7 +144,7 @@ func (c ApiComment) Create() revel.Result {
return c.ApiError(http.StatusBadRequest, ERR_EMPTY_STRING)
}
user, err := models.CurrentUser(c.Params, c.Session)
user, err := models.CurrentUser(c.Controller)
if err != nil {
c.Log.Error(TAG, "db", err, "api", ERR_UNAUTHORIZED)
return c.ApiError(http.StatusUnauthorized, ERR_UNAUTHORIZED)
......
......@@ -169,7 +169,7 @@ func (l ApiLike) Create() revel.Result {
return l.ApiError(http.StatusNotFound, ERR_NOT_FOUND)
}
user, err := models.CurrentUser(l.Params, l.Session)
user, err := models.CurrentUser(l.Controller)
if err != nil {
l.Log.Error(TAG, "db", err, "api", ERR_UNAUTHORIZED)
return l.ApiError(http.StatusUnauthorized, ERR_UNAUTHORIZED)
......
......@@ -84,7 +84,7 @@ type ApiNotification struct {
*
*/
func (n ApiNotification) Index(fields string, offset int) revel.Result {
user, err := models.CurrentUser(n)
user, err := models.CurrentUser(n.Controller)
if err != nil {
n.Log.Error(TAG, "db", err, "api", ERR_UNAUTHORIZED)
return n.ApiError(http.StatusUnauthorized, ERR_UNAUTHORIZED)
......@@ -155,7 +155,7 @@ func (n ApiNotification) Show() revel.Result {
*
*/
func (n ApiNotification) Update(id uint) revel.Result {
user, err := models.CurrentUser(n.Params, n.Session)
user, err := models.CurrentUser(n.Controller)
if err != nil {
n.Log.Error(TAG, "db", err, "api", ERR_UNAUTHORIZED)
return n.ApiError(http.StatusUnauthorized, ERR_UNAUTHORIZED)
......
......@@ -174,7 +174,7 @@ func (o ApiOAuth) Create() revel.Result {
*/
func (o ApiOAuth) Delete(id uint) revel.Result {
token := models.OAuthToken{ID: id}
user, err := models.CurrentUser(o.Params, o.Session)
user, err := models.CurrentUser(o.Controller)
if err != nil {
o.Log.Error(TAG, "err", err, "api", ERR_UNAUTHORIZED)
return o.ApiError(http.StatusUnauthorized, ERR_UNAUTHORIZED)
......
......@@ -99,7 +99,7 @@ func (p ApiPost) Index() revel.Result {
p.Params.Bind(&fields, "fields")
p.Params.Bind(&visibility, "visibility")
user, err := models.CurrentUser(p.Params, p.Session)
user, err := models.CurrentUser(p.Controller)
if err != nil {
p.Log.Error(TAG, "db", err, "api", ERR_UNAUTHORIZED)
return p.ApiError(http.StatusUnauthorized, ERR_UNAUTHORIZED)
......@@ -188,7 +188,7 @@ func (p ApiPost) Create() revel.Result {
return p.ApiError(http.StatusBadRequest, ERR_EMPTY_STRING)
}
user, err := models.CurrentUser(p.Params, p.Session)
user, err := models.CurrentUser(p.Controller)
if err != nil {
p.Log.Error(TAG, "db", err, "api", ERR_UNAUTHORIZED)
return p.ApiError(http.StatusUnauthorized, ERR_UNAUTHORIZED)
......@@ -309,7 +309,7 @@ func (p ApiPost) Show(guid string) revel.Result {
p.Params.Bind(&fields, "fields")
user, err := models.CurrentUser(p.Params, p.Session)
user, err := models.CurrentUser(p.Controller)
if err != nil {
p.Log.Error(TAG, "db", err, "api", ERR_UNAUTHORIZED)
return p.ApiError(http.StatusUnauthorized, ERR_UNAUTHORIZED)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment