| @@ 129-140 (lines=12) @@ | ||
| 126 | * |
|
| 127 | * @return mixed |
|
| 128 | */ |
|
| 129 | public function getAllPermissions() |
|
| 130 | { |
|
| 131 | $model = is_a($this, config('laravel-acl.level'), true) ? 'Level' : 'User'; |
|
| 132 | ||
| 133 | return \Cache::remember( |
|
| 134 | 'laravel-acl.getAllPermissionsFor' . $model . '_' . $this->id, |
|
| 135 | config('laravel-acl.cacheMinutes'), |
|
| 136 | function () { |
|
| 137 | return $this->cacheGetAllPermissions(); |
|
| 138 | } |
|
| 139 | ); |
|
| 140 | } |
|
| 141 | ||
| 142 | /** |
|
| 143 | * USER & LEVEL |
|
| @@ 151-162 (lines=12) @@ | ||
| 148 | * |
|
| 149 | * @return mixed |
|
| 150 | */ |
|
| 151 | public function getInheritedPermissions() |
|
| 152 | { |
|
| 153 | $model = is_a($this, config('laravel-acl.level'), true) ? 'Level' : 'User'; |
|
| 154 | ||
| 155 | return \Cache::remember( |
|
| 156 | 'laravel-acl.getInheritedPermissionsFor' . $model . '_' . $this->id, |
|
| 157 | config('laravel-acl.cacheMinutes'), |
|
| 158 | function () { |
|
| 159 | return $this->cacheGetInheritedPermissions(); |
|
| 160 | } |
|
| 161 | ); |
|
| 162 | } |
|
| 163 | ||
| 164 | /** |
|
| 165 | * USER & LEVEL |
|
| @@ 173-184 (lines=12) @@ | ||
| 170 | * |
|
| 171 | * @return mixed |
|
| 172 | */ |
|
| 173 | public function getAvailablePermissions() |
|
| 174 | { |
|
| 175 | $model = is_a($this, config('laravel-acl.level'), true) ? 'Level' : 'User'; |
|
| 176 | ||
| 177 | return \Cache::remember( |
|
| 178 | 'laravel-acl.getAvailablePermissionsFor' . $model . '_' . $this->id, |
|
| 179 | config('laravel-acl.cacheMinutes'), |
|
| 180 | function () { |
|
| 181 | return $this->cacheGetAvailablePermissions(); |
|
| 182 | } |
|
| 183 | ); |
|
| 184 | } |
|
| 185 | ||
| 186 | /** |
|
| 187 | * USER & LEVEL |
|