return $value !== 'no';
});
ksort($this->installedAppsCache);
- foreach ($this->installedAppsCache as $appId => $value) {
- if (!\OC::$server->getLockdownManager()->canAccessApp($appId)) {
- unset($this->installedAppsCache[$appId]);
- }
- }
}
return $this->installedAppsCache;
}
$scope = json_decode($this->getScope(), true);
if (!$scope) {
return [
- 'filesystem'=> true,
- 'apps' => []
+ 'filesystem'=> true
];
}
return $scope;
}
return !$this->scope || $this->scope['filesystem'];
}
-
- public function canAccessApp($app) {
- if (!$this->enabled) {
- return true;
- }
- if ($this->scope && $this->scope['apps']) {
- return in_array($app, $this->scope['apps']);
- } else {
- // no limit
- return true;
- }
- }
}
public static function loadApp($app, $checkUpgrade = true) {
self::$loadedApps[] = $app;
$appPath = self::getAppPath($app);
- if($appPath === false || !\OC::$server->getLockdownManager()->canAccessApp($app)) {
+ if($appPath === false) {
return;
}
use OC\Authentication\Token\IToken;
+/**
+ * @since 9.2
+ */
interface ILockdownManager {
+ /**
+ * Enable the lockdown restrictions
+ *
+ * @since 9.2
+ */
public function enable();
+ /**
+ * Set the active token to get the restrictions from and enable the lockdown
+ *
+ * @param IToken $token
+ * @since 9.2
+ */
public function setToken(IToken $token);
+ /**
+ * Check whether or not filesystem access is allowed
+ *
+ * @return bool
+ * @since 9.2
+ */
public function canAccessFilesystem();
-
- public function canAccessApp($app);
}