task: metadata: install: pip install -e .[dev]
patch: diff --git a/casbin/constant/constants.py b/casbin/constant/constants.py
index c5b89b3..428dc13 100644
--- a/casbin/constant/constants.py
+++ b/casbin/constant/constants.py
@@ -13,6 +13,7 @@
 # limitations under the License.
 
 # Index constants
+ACTION_INDEX = "act"
 DOMAIN_INDEX = "dom"
 SUBJECT_INDEX = "sub"
 OBJECT_INDEX = "obj"
diff --git a/casbin/management_enforcer.py b/casbin/management_enforcer.py
index b374ce1..b1897fa 100644
--- a/casbin/management_enforcer.py
+++ b/casbin/management_enforcer.py
@@ -14,6 +14,7 @@
 
 from casbin.internal_enforcer import InternalEnforcer
 from casbin.model.policy_op import PolicyOp
+from casbin.constant.constants import ACTION_INDEX, SUBJECT_INDEX, OBJECT_INDEX
 
 
 class ManagementEnforcer(InternalEnforcer):
@@ -27,7 +28,8 @@ class ManagementEnforcer(InternalEnforcer):
 
     def get_all_named_subjects(self, ptype):
         """gets the list of subjects that show up in the current named policy."""
-        return self.model.get_values_for_field_in_policy("p", ptype, 0)
+        field_index = self.model.get_field_index(ptype, SUBJECT_INDEX)
+        return self.model.get_values_for_field_in_policy("p", ptype, field_index)
 
     def get_all_objects(self):
         """gets the list of objects that show up in the current policy."""
@@ -35,7 +37,8 @@ class ManagementEnforcer(InternalEnforcer):
 
     def get_all_named_objects(self, ptype):
         """gets the list of objects that show up in the current named policy."""
-        return self.model.get_values_for_field_in_policy("p", ptype, 1)
+        field_index = self.model.get_field_index(ptype, OBJECT_INDEX)
+        return self.model.get_values_for_field_in_policy("p", ptype, field_index)
 
     def get_all_actions(self):
         """gets the list of actions that show up in the current policy."""
@@ -43,7 +46,8 @@ class ManagementEnforcer(InternalEnforcer):
 
     def get_all_named_actions(self, ptype):
         """gets the list of actions that show up in the current named policy."""
-        return self.model.get_values_for_field_in_policy("p", ptype, 2)
+        field_index = self.model.get_field_index(ptype, ACTION_INDEX)
+        return self.model.get_values_for_field_in_policy("p", ptype, field_index)
 
     def get_all_roles(self):
         """gets the list of roles that show up in the current named policy."""

problem_statement: RBAC with Domain model ,get_all_subjects error
1、model.conf
![image](https://github.com/casbin/pycasbin/assets/32121721/9cd37638-a702-4138-8544-50fbdaa0e55f)
2、code：
![image](https://github.com/casbin/pycasbin/assets/32121721/5041e3a1-af32-41a5-8895-227289c759b2)
3、sqlite info
![image](https://github.com/casbin/pycasbin/assets/32121721/f66c78a6-a64c-43fe-9985-e18edde72b65)

question:
e.get_all_objects()  --> ['test.xxx.com']
it should be ['system:get','system:put','system:post']
repo: casbin/pycasbin
test_cmd: pytest --no-header -rA --tb=line --color=no -p no:cacheprovider -W ignore::DeprecationWarning
test_patch: diff --git a/tests/test_management_api.py b/tests/test_management_api.py
index 84f5522..e924daa 100644
--- a/tests/test_management_api.py
+++ b/tests/test_management_api.py
@@ -38,6 +38,18 @@ class TestManagementApi(TestCaseBase):
         self.assertEqual(e.get_all_actions(), ["read", "write"])
         self.assertEqual(e.get_all_roles(), ["data2_admin"])
 
+    def test_get_list_with_domains(self):
+        e = self.get_enforcer(
+            get_examples("rbac_with_domains_model.conf"),
+            get_examples("rbac_with_domains_policy.csv"),
+            # True,
+        )
+
+        self.assertEqual(e.get_all_subjects(), ["admin"])
+        self.assertEqual(e.get_all_objects(), ["data1", "data2"])
+        self.assertEqual(e.get_all_actions(), ["read", "write"])
+        self.assertEqual(e.get_all_roles(), ["admin"])
+
     def test_get_policy_api(self):
         e = self.get_enforcer(
             get_examples("rbac_model.conf"),