Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion languages/en.php
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
* Move group
*/
'au_subgroups:move:edit:title' => "Make this group a subgroup of another group",
'au_subgroups:transfer:help' => "You can set this group as a subgroup of any other group you have permissions to edit. If users are not a member of the new parent group, they will be removed from this group and sent a new invitation that will enroll them in the new parent group and all subgroups leading to this one. <b>This will also transfer any subgroups of this group</b>",
'au_subgroups:transfer:help' => "You can set this group as a subgroup of any other group you have permissions to edit if and only if this group owner is already a member of the new parent group. If other users are not members of the new parent group, they will be removed from this group and sent a new invitation that will enroll them in the new parent group and all subgroups leading to this one. <b>This will also transfer any subgroups of this group</b>",
'au_subgroups:search:text' => "Search Groups",
'au_subgroups:search:noresults' => "No groups found",
'au_subgroups:error:timeout' => "Search timed out",
Expand Down
5 changes: 5 additions & 0 deletions lib/functions.php
Original file line number Diff line number Diff line change
Expand Up @@ -289,6 +289,11 @@ function can_move_subgroup($subgroup, $parent, $user = NULL) {
return false;
}

// make sure subgroup owner is member of target parent group
if (!$parent->isMember($subgroup->getOwnerEntity())) {
return false;
}

// make sure we can edit all the way up, and we're not trying to move a group into itself
if (!can_edit_recursive($subgroup) || $subgroup->guid == $parent->guid) {
return false;
Expand Down