iappmanager.php 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102
  1. <?php
  2. /**
  3. * @author Lukas Reschke <lukas@owncloud.com>
  4. * @author Morris Jobke <hey@morrisjobke.de>
  5. * @author Robin Appelman <icewind@owncloud.com>
  6. *
  7. * @copyright Copyright (c) 2015, ownCloud, Inc.
  8. * @license AGPL-3.0
  9. *
  10. * This code is free software: you can redistribute it and/or modify
  11. * it under the terms of the GNU Affero General Public License, version 3,
  12. * as published by the Free Software Foundation.
  13. *
  14. * This program is distributed in the hope that it will be useful,
  15. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  16. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  17. * GNU Affero General Public License for more details.
  18. *
  19. * You should have received a copy of the GNU Affero General Public License, version 3,
  20. * along with this program. If not, see <http://www.gnu.org/licenses/>
  21. *
  22. */
  23. namespace OCP\App;
  24. use OCP\IUser;
  25. /**
  26. * Interface IAppManager
  27. *
  28. * @package OCP\App
  29. * @since 8.0.0
  30. */
  31. interface IAppManager {
  32. /**
  33. * Check if an app is enabled for user
  34. *
  35. * @param string $appId
  36. * @param \OCP\IUser $user (optional) if not defined, the currently loggedin user will be used
  37. * @return bool
  38. * @since 8.0.0
  39. */
  40. public function isEnabledForUser($appId, $user = null);
  41. /**
  42. * Check if an app is installed in the instance
  43. *
  44. * @param string $appId
  45. * @return bool
  46. * @since 8.0.0
  47. */
  48. public function isInstalled($appId);
  49. /**
  50. * Enable an app for every user
  51. *
  52. * @param string $appId
  53. * @since 8.0.0
  54. */
  55. public function enableApp($appId);
  56. /**
  57. * Enable an app only for specific groups
  58. *
  59. * @param string $appId
  60. * @param \OCP\IGroup[] $groups
  61. * @since 8.0.0
  62. */
  63. public function enableAppForGroups($appId, $groups);
  64. /**
  65. * Disable an app for every user
  66. *
  67. * @param string $appId
  68. * @since 8.0.0
  69. */
  70. public function disableApp($appId);
  71. /**
  72. * List all apps enabled for a user
  73. *
  74. * @param \OCP\IUser $user
  75. * @return string[]
  76. * @since 8.1.0
  77. */
  78. public function getEnabledAppsForUser(IUser $user);
  79. /**
  80. * List all installed apps
  81. *
  82. * @return string[]
  83. * @since 8.1.0
  84. */
  85. public function getInstalledApps();
  86. /**
  87. * Clear the cached list of apps when enabling/disabling an app
  88. * @since 8.1.0
  89. */
  90. public function clearAppsCache();
  91. }