This is an automated email from the ASF dual-hosted git repository.
hsluoyz pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/casbin.git
The following commit(s) were added to refs/heads/master by this push:
new 0a60019 fix: look up subject index by ptype in
GetNamedPermissionsForUser (#1759)
0a60019 is described below
commit 0a600195968dc80d2f40ce5fdfe55ce561234d16
Author: Yang Luo <[email protected]>
AuthorDate: Wed Sep 9 22:51:38 2026 +0800
fix: look up subject index by ptype in GetNamedPermissionsForUser (#1759)
---
rbac_api.go | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/rbac_api.go b/rbac_api.go
index 58a4b1c..a130491 100644
--- a/rbac_api.go
+++ b/rbac_api.go
@@ -197,7 +197,7 @@ func (e *Enforcer) GetNamedPermissionsForUser(ptype string,
user string, domain
continue
}
args := make([]string, len(assertion.Tokens))
- subIndex, err := e.GetFieldIndex("p", constant.SubjectIndex)
+ subIndex, err := e.GetFieldIndex(ptype, constant.SubjectIndex)
if err != nil {
subIndex = 0
}
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]