Commit dc254bca authored by Robert Lyon's avatar Robert Lyon
Browse files

Bug 1658393: Respect group copying rules



When copying (therefore creating) a group owned by an institution
we check if user can edit institution - if not we set institution
to 'mahara'

behatnotneeded

Change-Id: I648d74a70016d4b68e738147cc63952ec8261926
Signed-off-by: default avatarRobert Lyon <robertl@catalyst.net.nz>
(cherry picked from commit 0524e220)
parent e6711554
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -378,8 +378,8 @@ function group_create($data) {

    if (!empty($data['institution']) && $data['institution'] != 'mahara') {
        global $USER;
        if (!$USER->can_edit_institution($data['institution'])) {
            throw new AccessDeniedException("group_create: cannot create a group in this institution");
        if (!$USER->can_edit_institution($data['institution'], true)) {
            $data['institution'] = 'mahara';
        }
    }
    else {