diff --git a/.idea/dataSources/74bcf3ef-a2b9-435b-b9e5-f32902a33b25.xml b/.idea/dataSources/74bcf3ef-a2b9-435b-b9e5-f32902a33b25.xml
index 548fa8f..fe94dab 100644
--- a/.idea/dataSources/74bcf3ef-a2b9-435b-b9e5-f32902a33b25.xml
+++ b/.idea/dataSources/74bcf3ef-a2b9-435b-b9e5-f32902a33b25.xml
@@ -838,50 +838,50 @@ false Zulu
1
1
-
- 4544
-
-
- 6304
-
-
+
6171
-
- 4571
+
+ 6181
-
+
+ 6182
+
+
3373
3374
3375
3377
-
- 6181
-
-
+
3374
-
+
3375
-
- 4569
-
-
- 4200
-
-
+
3377
-
+
+ 4569
+
+
+ 4570
+
+
+ 4571
+
+
+ 4200
+
+
+ 4544
+
+
4550
-
- 6182
-
-
- 4570
+
+ 6304
1
diff --git a/.idea/workspace.xml b/.idea/workspace.xml
index 54c3c1d..076fae6 100644
--- a/.idea/workspace.xml
+++ b/.idea/workspace.xml
@@ -4,13 +4,10 @@
-
+
+
-
-
-
-
@@ -49,7 +46,7 @@
-
@@ -169,7 +165,8 @@
-
+
+
true
diff --git a/pkg/grpc/auth.go b/pkg/grpc/auth.go
index ad8e536..f570141 100644
--- a/pkg/grpc/auth.go
+++ b/pkg/grpc/auth.go
@@ -48,9 +48,13 @@ func (v *Server) CheckPerm(_ context.Context, in *proto.CheckPermRequest) (*prot
return nil, err
}
+ var heldPerms map[string]any
+ rawHeldPerms, _ := jsoniter.Marshal(ctx.Account.PermNodes)
+ _ = jsoniter.Unmarshal(rawHeldPerms, &heldPerms)
+
var value any
_ = jsoniter.Unmarshal(in.GetValue(), &value)
- perms := services.FilterPermNodes(ctx.Account.PermNodes, ctx.Ticket.Claims)
+ perms := services.FilterPermNodes(heldPerms, ctx.Ticket.Claims)
valid := services.HasPermNode(perms, in.GetKey(), value)
return &proto.CheckPermReply{
diff --git a/pkg/services/auth.go b/pkg/services/auth.go
index 0e1141b..f85967b 100644
--- a/pkg/services/auth.go
+++ b/pkg/services/auth.go
@@ -2,6 +2,7 @@ package services
import (
"fmt"
+ jsoniter "github.com/json-iterator/go"
"time"
"git.solsynth.dev/hydrogen/passport/pkg/models"
@@ -30,7 +31,11 @@ func Authenticate(access, refresh string, depth int) (ctx models.AuthContext, pe
newRefresh = refresh
if ctx, err = GetAuthContext(claims.ID); err == nil {
- perms = FilterPermNodes(ctx.Account.PermNodes, ctx.Ticket.Claims)
+ var heldPerms map[string]any
+ rawHeldPerms, _ := jsoniter.Marshal(ctx.Account.PermNodes)
+ _ = jsoniter.Unmarshal(rawHeldPerms, &heldPerms)
+
+ perms = FilterPermNodes(heldPerms, ctx.Ticket.Claims)
return
}