parent
7e9e5db496
commit
c5df58ec69
|
@ -112,11 +112,6 @@ class AppManager implements IAppManager {
|
|||
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;
|
||||
}
|
||||
|
|
|
@ -154,8 +154,7 @@ class DefaultToken extends Entity implements IToken {
|
|||
$scope = json_decode($this->getScope(), true);
|
||||
if (!$scope) {
|
||||
return [
|
||||
'filesystem'=> true,
|
||||
'apps' => []
|
||||
'filesystem'=> true
|
||||
];
|
||||
}
|
||||
return $scope;
|
||||
|
|
|
@ -43,16 +43,4 @@ class LockdownManager implements ILockdownManager {
|
|||
}
|
||||
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;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -140,7 +140,7 @@ class OC_App {
|
|||
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;
|
||||
}
|
||||
|
||||
|
|
|
@ -21,12 +21,30 @@ namespace OCP\Lockdown;
|
|||
|
||||
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);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue