2014-11-07 16:26:12 +03:00
|
|
|
<?php
|
2015-02-26 13:37:37 +03:00
|
|
|
|
2014-11-07 16:26:12 +03:00
|
|
|
/**
|
2015-02-26 13:37:37 +03:00
|
|
|
* Copyright (c) 2014 Robin Appelman <icewind@owncloud.com>
|
|
|
|
* This file is licensed under the Affero General Public License version 3 or
|
|
|
|
* later.
|
|
|
|
* See the COPYING-README file.
|
2014-11-07 16:26:12 +03:00
|
|
|
*/
|
2015-02-26 13:37:37 +03:00
|
|
|
|
2014-11-07 16:26:12 +03:00
|
|
|
namespace OCP\App;
|
|
|
|
|
2015-02-02 16:47:29 +03:00
|
|
|
use OCP\IUser;
|
|
|
|
|
2014-11-07 16:26:12 +03:00
|
|
|
interface IAppManager {
|
|
|
|
/**
|
|
|
|
* Check if an app is enabled for user
|
|
|
|
*
|
|
|
|
* @param string $appId
|
|
|
|
* @param \OCP\IUser $user (optional) if not defined, the currently loggedin user will be used
|
|
|
|
* @return bool
|
|
|
|
*/
|
|
|
|
public function isEnabledForUser($appId, $user = null);
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Check if an app is installed in the instance
|
|
|
|
*
|
|
|
|
* @param string $appId
|
|
|
|
* @return bool
|
|
|
|
*/
|
|
|
|
public function isInstalled($appId);
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Enable an app for every user
|
|
|
|
*
|
|
|
|
* @param string $appId
|
|
|
|
*/
|
|
|
|
public function enableApp($appId);
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Enable an app only for specific groups
|
|
|
|
*
|
|
|
|
* @param string $appId
|
|
|
|
* @param \OCP\IGroup[] $groups
|
|
|
|
*/
|
|
|
|
public function enableAppForGroups($appId, $groups);
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Disable an app for every user
|
|
|
|
*
|
|
|
|
* @param string $appId
|
|
|
|
*/
|
|
|
|
public function disableApp($appId);
|
2015-02-02 16:47:29 +03:00
|
|
|
|
|
|
|
/**
|
|
|
|
* List all apps enabled for a user
|
|
|
|
*
|
|
|
|
* @param \OCP\IUser $user
|
|
|
|
* @return string[]
|
|
|
|
*/
|
2015-02-05 17:11:07 +03:00
|
|
|
public function getEnabledAppsForUser(IUser $user);
|
2015-02-02 16:47:29 +03:00
|
|
|
|
|
|
|
/**
|
|
|
|
* List all installed apps
|
|
|
|
*
|
|
|
|
* @return string[]
|
|
|
|
*/
|
|
|
|
public function getInstalledApps();
|
2014-11-07 16:26:12 +03:00
|
|
|
}
|