| @@ 179-188 (lines=10) @@ | ||
| 176 | * @param $permission | |
| 177 | * @return bool | |
| 178 | */ | |
| 179 | public function hasPermissionTo($permission) | |
| 180 |     { | |
| 181 | return Cache::remember( | |
| 182 | 'laravel-acl.hasPermissionTo_' . (new ReflectionClass($this))->getShortName() . '_' . $this->id . '_Permission_' . $permission, | |
| 183 |             config('laravel-acl.cacheMinutes'), | |
| 184 |             function() use ($permission) { | |
| 185 | return $this->cacheHasPermissionTo($permission); | |
| 186 | } | |
| 187 | ); | |
| 188 | } | |
| 189 | ||
| 190 | /** | |
| 191 | * USER & LEVEL | |
| @@ 241-250 (lines=10) @@ | ||
| 238 | * @param $type | |
| 239 | * @return \Illuminate\Support\Collection | |
| 240 | */ | |
| 241 | protected function cachePull($type) | |
| 242 |     { | |
| 243 | return Cache::remember( | |
| 244 | 'laravel-acl.' . lcfirst(substr($type, 5)) . 'For' . (new ReflectionClass($this))->getShortName() . '_' . $this->id, | |
| 245 |             config('laravel-acl.cacheMinutes'), | |
| 246 |             function() use ($type) { | |
| 247 |                 return $this->{$type}(); | |
| 248 | } | |
| 249 | ); | |
| 250 | } | |
| 251 | /** | |
| 252 | * USER & LEVEL | |
| 253 | * Return a collection of permissions | |