working sections version

This commit is contained in:
ston1th 2019-03-27 23:08:59 +01:00
commit 9424084a36
28 changed files with 367 additions and 251 deletions

View file

@ -4,6 +4,7 @@ package db
import (
"git.giftfish.de/ston1th/gowiki/pkg/core"
"git.giftfish.de/ston1th/gowiki/pkg/log"
"git.giftfish.de/ston1th/gowiki/pkg/render"
)
@ -11,6 +12,7 @@ func (db *DB) ReadPerm(st, username string, p core.Permission) bool {
section, _ := render.SplitStoreTitle(st)
s, err := db.GetSection(section)
if err != nil {
log.Debugf("db: read: %s", err)
return false
}
return core.ReadPerm(username, p, s)
@ -20,6 +22,7 @@ func (db *DB) WritePerm(st, username string, p core.Permission) bool {
section, _ := render.SplitStoreTitle(st)
s, err := db.GetSection(section)
if err != nil {
log.Debugf("db: read: %s", err)
return false
}
return core.WritePerm(username, p, s)