fixed permissions and style
This commit is contained in:
parent
3fb1cfc17d
commit
575a41127f
12 changed files with 107 additions and 53 deletions
|
|
@ -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)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue