summaryrefslogtreecommitdiffstats
path: root/lib/private/app.php
diff options
context:
space:
mode:
authorJoas Schilling <nickvergessen@owncloud.com>2015-03-24 12:56:42 +0100
committerJoas Schilling <nickvergessen@owncloud.com>2015-03-24 12:56:42 +0100
commitb262c30fa9780290ecd0411cee2c4da5c24066b2 (patch)
tree68a2837848c59f71a931dca65ab706ba543ddcac /lib/private/app.php
parent9cb07f126d027ddc0610fe0fcfd43016bc960ddb (diff)
downloadnextcloud-server-b262c30fa9780290ecd0411cee2c4da5c24066b2.tar.gz
nextcloud-server-b262c30fa9780290ecd0411cee2c4da5c24066b2.zip
Correctly get array of groups and send OCP\IGroup objects to enable method
Diffstat (limited to 'lib/private/app.php')
-rw-r--r--lib/private/app.php10
1 files changed, 9 insertions, 1 deletions
diff --git a/lib/private/app.php b/lib/private/app.php
index 1b004154173..dce159d574c 100644
--- a/lib/private/app.php
+++ b/lib/private/app.php
@@ -269,7 +269,15 @@ class OC_App {
$appManager = \OC::$server->getAppManager();
if (!is_null($groups)) {
- $appManager->enableAppForGroups($app, $groups);
+ $groupManager = \OC::$server->getGroupManager();
+ $groupsList = [];
+ foreach ($groups as $group) {
+ $groupItem = $groupManager->get($group);
+ if ($groupItem instanceof \OCP\IGroup) {
+ $groupsList[] = $groupManager->get($group);
+ }
+ }
+ $appManager->enableAppForGroups($app, $groupsList);
} else {
$appManager->enableApp($app);
}