@@ 227-237 (lines=11) @@ | ||
224 | * @param Member|null $member The {@link Member} object to test against. |
|
225 | * @return true if $member (or the currently logged in member if null) can upload this archive |
|
226 | */ |
|
227 | public function canRestore($member = null) { |
|
228 | $memberID = $member ? $member->ID : Member::currentUserID(); |
|
229 | if(!$memberID) { |
|
230 | return false; |
|
231 | } |
|
232 | ||
233 | $key = $memberID . '-' . $this->EnvironmentID; |
|
234 | if(!isset(self::$_cache_can_restore[$key])) { |
|
235 | self::$_cache_can_restore[$key] = $this->Environment()->canUploadArchive($member); |
|
236 | } |
|
237 | ||
238 | return self::$_cache_can_restore[$key]; |
|
239 | } |
|
240 | ||
@@ 248-257 (lines=10) @@ | ||
245 | * @param Member|null $member The {@link Member} object to test against. |
|
246 | * @return true if $member (or the currently logged in member if null) can download this archive |
|
247 | */ |
|
248 | public function canDownload($member = null) { |
|
249 | $memberID = $member ? $member->ID : Member::currentUserID(); |
|
250 | if(!$memberID) { |
|
251 | return false; |
|
252 | } |
|
253 | ||
254 | $key = $memberID . '-' . $this->EnvironmentID; |
|
255 | if(!isset(self::$_cache_can_download[$key])) { |
|
256 | self::$_cache_can_download[$key] = $this->Environment()->canDownloadArchive($member); |
|
257 | } |
|
258 | return self::$_cache_can_download[$key]; |
|
259 | } |
|
260 |