@@ -27,23 +27,26 @@ def get_all_subjects(self):
27
27
28
28
def get_all_named_subjects (self , ptype ):
29
29
"""gets the list of subjects that show up in the current named policy."""
30
- return self .model .get_values_for_field_in_policy ("p" , ptype , 0 )
30
+ field_index = self .model .get_field_index (ptype , "sub" )
31
+ return self .model .get_values_for_field_in_policy ("p" , ptype , field_index )
31
32
32
33
def get_all_objects (self ):
33
34
"""gets the list of objects that show up in the current policy."""
34
35
return self .get_all_named_objects ("p" )
35
36
36
37
def get_all_named_objects (self , ptype ):
37
38
"""gets the list of objects that show up in the current named policy."""
38
- return self .model .get_values_for_field_in_policy ("p" , ptype , 1 )
39
+ field_index = self .model .get_field_index (ptype , "obj" )
40
+ return self .model .get_values_for_field_in_policy ("p" , ptype , field_index )
39
41
40
42
def get_all_actions (self ):
41
43
"""gets the list of actions that show up in the current policy."""
42
44
return self .get_all_named_actions ("p" )
43
45
44
46
def get_all_named_actions (self , ptype ):
45
47
"""gets the list of actions that show up in the current named policy."""
46
- return self .model .get_values_for_field_in_policy ("p" , ptype , 2 )
48
+ field_index = self .model .get_field_index (ptype , "act" )
49
+ return self .model .get_values_for_field_in_policy ("p" , ptype , field_index )
47
50
48
51
def get_all_roles (self ):
49
52
"""gets the list of roles that show up in the current named policy."""
0 commit comments