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 5341c6b  fix: use ptype in GetNamedPermissionsForUser for subject 
index (#1760)
5341c6b is described below

commit 5341c6b4211167e8144975c805cfd57a8c9e7965
Author: Arshil-Khan <[email protected]>
AuthorDate: Wed Sep 9 20:24:20 2026 +0530

    fix: use ptype in GetNamedPermissionsForUser for subject index (#1760)
---
 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]

Reply via email to