working sections version
This commit is contained in:
parent
16ea95bf09
commit
9424084a36
28 changed files with 367 additions and 251 deletions
|
|
@ -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)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue