mirror of
https://github.com/nextcloud/server.git
synced 2026-05-28 04:32:30 -04:00
Correctly get array of groups and send OCP\IGroup objects to enable method
This commit is contained in:
parent
9cb07f126d
commit
b262c30fa9
2 changed files with 10 additions and 2 deletions
|
|
@ -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);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -406,7 +406,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 = [];
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue