Skip to content

πŸ“š The open-source, offline-first Notion, Obsidian & Confluence alternative. Advanced Markdown, multi-tenant teams, OIDC/SSO, and local S3 backups. Deploy in one command.

Remove old console print

Smaug6739a40b6c38e724
diff --git a/backend/permissions/service.go b/backend/permissions/service.go
index e2acd683..514f439b 100644
--- a/backend/permissions/service.go
+++ b/backend/permissions/service.go
@@ -5,7 +5,6 @@ import (
"alexandrie/services"
"alexandrie/types"
"errors"
- "fmt"
)
type Authorizer interface {
@@ -28,18 +27,15 @@ func (a *DefaultAuthorizer) CanAccessNode(userID types.Snowflake, userRole UserR
if userID == node.UserId {
return true, PermOwner, nil
}
- fmt.Println("Case 1 failed: not the owner")
// Case 2: Global app admin
if a.IsAppAdmin(userRole) {
return true, PermOwner, nil
}
- fmt.Println("Case 2 failed: not an app admin")
// Case 3: Check in DB via PermissionService
hasPermission, level := a.permService.HasPermission(userID, node.Id, int(action.RequiredLevel()))
if hasPermission {
return true, NodePermissionLevel(level), nil
}
- fmt.Println("Case 3 failed: no sufficient permission in DB")
return false, PermNone, errors.New("unauthorized")
}