예제 #1
0
파일: app.go 프로젝트: jango2015/bloggo
func (c Application) NavLeft() revel.Result {
	UserCreate := c.ActiveUser.CanBeCreatedBy(c.MongoSession, c.ActiveUser)

	article := new(models.Article)
	ArticleCreate := article.CanBeCreatedBy(c.MongoSession, c.ActiveUser)
	return c.Render(UserCreate, ArticleCreate)
}
예제 #2
0
파일: blog.go 프로젝트: jango2015/bloggo
func (c Blog) GetCreate() revel.Result {
	article := models.Article{}
	if article.CanBeCreatedBy(c.MongoSession, c.ActiveUser) {
		action := "/blog/create"
		actionButton := "Create"
		return c.Render(action, article, actionButton)
	}
	return c.Forbidden("You are not allowed to create articles.")
}