fixed permissions and style

This commit is contained in:
ston1th 2018-09-17 23:54:55 +02:00
commit 575a41127f
12 changed files with 107 additions and 53 deletions

View file

@ -60,9 +60,13 @@ func (db *DB) CreatePage(title, section, markdown, username string, p core.Permi
err = errInvalidPermission
return
}
if section == core.WikiSection && p == core.Private {
err = errPrivateWikiPage
return
owner := username
if section == core.WikiSection {
owner = core.WikiSection
if p == core.Private {
err = errPrivateWikiPage
return
}
}
st := render.StoreTitle(section, title)
if _, err = db.getPage(st, username); err != nil && err != store.ErrKeyNotFound {
@ -74,7 +78,7 @@ func (db *DB) CreatePage(title, section, markdown, username string, p core.Permi
StoreTitle: st,
Markdown: markdown,
Created: created(username),
Owner: username,
Owner: owner,
Perm: p,
}
//search := render.Render(page)