/** * Checks if the given subject is within one of the registered user * filemounts. If not, working with the file is not permitted for the user. * * @param $subject * @return boolean */ public function isWithinFileMountBoundaries($subject) { $isWithinFilemount = TRUE; if (is_array($this->fileMounts)) { $isWithinFilemount = FALSE; if (!$subject) { $subject = $this->getRootLevelFolder(); } $identifier = $subject->getIdentifier(); // Check if the identifier of the subject is within at // least one of the file mounts foreach ($this->fileMounts as $fileMount) { if ($this->driver->isWithin($fileMount['folder'], $identifier)) { $isWithinFilemount = TRUE; break; } } } return $isWithinFilemount; }