Refactor architecture into eight components and consolidate reliability work
Extract Grammaratur, Dregarnuhr, Geduldh, Mestionora, Ordoschnellic, Schutzaria, Kunstzeal and Seheweit behind compatible application contracts. Include accumulated editor resilience, navigation and theme UX, remote CLI, storage/schema and DR groundwork, tests and design/operations documentation. Verified: uncached full Go suite; go vet ./...; race tests for all eight components; 11 targeted Chromium tests; Node suites; 19 Python CLI tests; reproducible editor build. No push, release tag or deployment in this checkpoint.
This commit is contained in:
1 parent
9dd425f765
commit
d5d21b7841
302 files changed
+20037
-3492
No files matched your search
@@ -7,6 +7,8 @@ import (
|
||||
"time"
|
||||
|
||||
"github.com/google/uuid"
|
||||
|
||||
"pageswiki/internal/schutzaria"
|
||||
)
|
||||
|
||||
var groupNamePattern = regexp.MustCompile(`^[a-z0-9][a-z0-9_-]{1,63}$`)
|
||||
@@ -25,19 +27,8 @@ type GroupPermission struct {
|
||||
UUID, GroupUUID, ScopePath, Permission string
|
||||
}
|
||||
|
||||
var groupPermissions = map[string]map[string]bool{
|
||||
"read": {"read": true},
|
||||
"read_write_once": {"read": true, "create": true, "upload": true},
|
||||
"read_write": {"read": true, "create": true, "write": true, "upload": true, "rename": true, "link": true},
|
||||
"upload_only": {"upload": true},
|
||||
}
|
||||
|
||||
func NormalizeGroupPermission(value string) (string, error) {
|
||||
value = strings.ToLower(strings.TrimSpace(value))
|
||||
if _, ok := groupPermissions[value]; !ok {
|
||||
return "", errors.New("invalid group permission")
|
||||
}
|
||||
return value, nil
|
||||
return schutzaria.NormalizeGroupPermission(value)
|
||||
}
|
||||
|
||||
func normalizeGroupName(name string) (string, error) {
|
||||
@@ -375,8 +366,7 @@ func groupPermissionAllowsFrom(q pathQueryer, domainUUID, principalUUID, capabil
|
||||
if err := rows.Scan(&scope, &permission); err != nil {
|
||||
return false, err
|
||||
}
|
||||
inside := targetPath == scope || scope == "/" || strings.HasPrefix(targetPath, strings.TrimRight(scope, "/")+"/")
|
||||
if inside && groupPermissions[permission][capability] {
|
||||
if schutzaria.GroupPermissionAllows(scope, permission, capability, targetPath) {
|
||||
return true, nil
|
||||
}
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user