Commit 5e71d155 authored by Joas Schilling's avatar Joas Schilling
Browse files

Merge pull request #15149 from owncloud/fix-enable-for-group

Correctly get array of groups and send OCP\IGroup objects to enable meth...
parents 302c1906 b262c30f
......@@ -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);
}
......
......@@ -413,7 +413,7 @@ OC.Settings.Apps = OC.Settings.Apps || {
var element = $(this).parent().find('input.enable');
var groups = $(this).val();
if (groups && groups !== '') {
groups = groups.split(',');
groups = groups.split('|');
} else {
groups = [];
}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment