@@ -47,7 +47,7 @@ public function savePolicyLine($ptype, array $rule)
4747 foreach ($ rule as $ key => $ value ) {
4848 $ col ['v ' .strval ($ key ).'' ] = $ value ;
4949 }
50- $ this ->model ->create ($ col );
50+ $ this ->model ->cache ( ' tauthz ' )-> save ($ col );
5151 }
5252
5353 /**
@@ -57,7 +57,7 @@ public function savePolicyLine($ptype, array $rule)
5757 */
5858 public function loadPolicy (Model $ model ): void
5959 {
60- $ rows = $ this ->model ->select ()->toArray ();
60+ $ rows = $ this ->model ->cache ( ' tauthz ' )-> select ()->toArray ();
6161 foreach ($ rows as $ row ) {
6262 $ line = implode (', ' , array_filter (array_slice ($ row , 1 ), function ($ val ) {
6363 return '' != $ val && !is_null ($ val );
@@ -117,7 +117,7 @@ public function removePolicy(string $sec, string $ptype, array $rule): void
117117 }
118118
119119 foreach ($ instance ->select () as $ model ) {
120- if ($ model ->delete ()) {
120+ if ($ model ->cache ( ' tauthz ' )-> delete ()) {
121121 ++$ count ;
122122 }
123123 }
@@ -146,7 +146,7 @@ public function removeFilteredPolicy(string $sec, string $ptype, int $fieldIndex
146146 }
147147
148148 foreach ($ instance ->select () as $ model ) {
149- if ($ model ->delete ()) {
149+ if ($ model ->cache ( ' tauthz ' )-> delete ()) {
150150 ++$ count ;
151151 }
152152 }
0 commit comments