some tests and major cleanup
This commit is contained in:
parent
8ef2a2547c
commit
16671b3406
30 changed files with 192057 additions and 202431 deletions
|
|
@ -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 {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue