Commit c146953c authored by zauberstuhl's avatar zauberstuhl

Restrict posts to public and user msgs

parent ee81d279
......@@ -37,7 +37,14 @@ func (p ApiPost) Index() revel.Result {
)
p.Params.Bind(&offset, "offset")
err := posts.FindAll(offset)
user, err := models.GetCurrentUser(p.Session["TOKEN"])
if err != nil {
revel.ERROR.Println(err)
return p.RenderError(err)
}
err = posts.FindAll(user.ID, offset)
if err != nil {
revel.ERROR.Println(err)
return p.RenderError(err)
......
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