Пример #1
0
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
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.")
}