@@ -47,7 +47,7 @@ public function savePolicyLine($ptype, array $rule)
47
47
foreach ($ rule as $ key => $ value ) {
48
48
$ col ['v ' .strval ($ key ).'' ] = $ value ;
49
49
}
50
- $ this ->model ->create ($ col );
50
+ $ this ->model ->cache ( ' tauthz ' )-> save ($ col );
51
51
}
52
52
53
53
/**
@@ -57,7 +57,7 @@ public function savePolicyLine($ptype, array $rule)
57
57
*/
58
58
public function loadPolicy (Model $ model ): void
59
59
{
60
- $ rows = $ this ->model ->select ()->toArray ();
60
+ $ rows = $ this ->model ->cache ( ' tauthz ' )-> select ()->toArray ();
61
61
foreach ($ rows as $ row ) {
62
62
$ line = implode (', ' , array_filter (array_slice ($ row , 1 ), function ($ val ) {
63
63
return '' != $ val && !is_null ($ val );
@@ -117,7 +117,7 @@ public function removePolicy(string $sec, string $ptype, array $rule): void
117
117
}
118
118
119
119
foreach ($ instance ->select () as $ model ) {
120
- if ($ model ->delete ()) {
120
+ if ($ model ->cache ( ' tauthz ' )-> delete ()) {
121
121
++$ count ;
122
122
}
123
123
}
@@ -146,7 +146,7 @@ public function removeFilteredPolicy(string $sec, string $ptype, int $fieldIndex
146
146
}
147
147
148
148
foreach ($ instance ->select () as $ model ) {
149
- if ($ model ->delete ()) {
149
+ if ($ model ->cache ( ' tauthz ' )-> delete ()) {
150
150
++$ count ;
151
151
}
152
152
}
0 commit comments