some tests and major cleanup

This commit is contained in:
ston1th 2018-10-19 23:08:32 +02:00
commit 16671b3406
30 changed files with 192057 additions and 202431 deletions

View file

@ -11,18 +11,6 @@ const (
Private
)
func ParsePerm(p int) Permission {
switch p {
case 1:
return Public
case 2:
return Internal
case 3:
return Private
}
return Invalid
}
func ParsePermString(p string) Permission {
switch p {
case "1":
@ -51,10 +39,6 @@ func WritePerm(username, section string, p *Page) bool {
if section != WikiSection && section != username {
return false
}
return writePerm(username, p)
}
func writePerm(username string, p *Page) bool {
switch p.Perm {
case Public, Internal:
if p.Owner == WikiSection {