canvas-lms/db/migrate/20210308200204_granular_man...

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

29 lines
1.1 KiB
Ruby
Raw Normal View History

add granular permissions for manage groups closes FOO-2038 refs FOO-1667 flag = granular_permissions_manage_groups [fsc-max-nodes=18] [fsc-timeout=30] [Test Plan] Student groups: These groups are self-organized by students. Unlike other types of groups, students can belong to more than one of these groups at a time, so these groups cannot be used for graded assignments. Course admin groups: Created only by and visible to course admins. These groups can be used for graded assignments. CREATE All four occurrences of the Group Set button should be governed by Group model :create permission, which can be granted via an active student enrollment + course setting to allow student organized groups OR the role override permission assumed automatically by Teachers, TA's, and Designers :manage_groups_add. Account-level Student Groups (/accounts/:id/groups) • Account --> People --> Hamburger menu --> View user groups --> Group Set button Course-level Student Groups (courses/:id/groups) • Course --> People --> Group Set button Existing Group Set • Course --> People --> Hamburger menu --> View User Groups --> Group Set button Empty Group Set • Course --> People --> Hamburger menu --> View User Groups --> Group Set button All occurrences of the +Group button should be governed by Group model :create permission, which can be granted via an active student enrollment + course setting to allow student organized groups OR the role override permission assumed automatically byTeachers, TA's, and Designers :manage_groups_add • +Group can be found via /accounts/:id/groups or /courses/:id/groups pages Assignment group set button: • Enable "This is a Group Assignment" • If there are no existing group sets, the "New Group Category" Modal should not open, and the teacher should not be able to save the assignment in this state, since they cannot create any • The "New Group Category" Button should be disabled • If there are existing group sets, this teacher should be able to select one and save the assignment • As a teacher *with* manage_groups_add permission or Group model :create permission, which can be granted via an active student enrollment + course setting to allow student organized groups • Enabling "This is a Group Assignment" should open the "New Group Category" Modal if there are no existing group sets and the "New Group Category" Button should be enabled MANAGE The +Import group(s), Randomly Assign Students, and Clone Group Set button should be governed by the role override permission assumed automatically by Teachers, TA's, and Designers :manage_groups_manage • +Import can be found only on /courses/:id/groups page • Hamburger menu group actions button Randomly Assign Students can be found only on /courses/:id/groups page under course admin groups • Hamburger menu group actions button Clone Group Set can be found only on /courses/:id/groups page under course admin groups • All occurrences of Hamburger menu group actions button containing Edit should be governed byGroup model :update, which can be granted through group moderator / leader OR the role override permission assumed automatically by Teachers, TA's, and Designers :manage_groups_manage DELETE All occurrences of Hamburger menu group actions button containing Delete should be governed byGroup model :delete, which can be granted through group moderator only OR the role override permission assumed automatically by Teachers, TA's, and Designers :manage_groups_delete Change-Id: Ibb9cdeb9944e3b87c20c426bb452ec92c52cda14 Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/260276 Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com> Reviewed-by: Simon Williams <simon@instructure.com> Reviewed-by: Charley Kline <ckline@instructure.com> QA-Review: Simon Williams <simon@instructure.com> QA-Review: Charley Kline <ckline@instructure.com> Product-Review: Simon Williams <simon@instructure.com>
2021-03-10 01:31:55 +08:00
# frozen_string_literal: true
#
# Copyright (C) 2021 - present Instructure, Inc.
#
# This file is part of Canvas.
#
# Canvas is free software: you can redistribute it and/or modify it under
# the terms of the GNU Affero General Public License as published by the Free
# Software Foundation, version 3 of the License.
#
# Canvas is distributed in the hope that it will be useful, but WITHOUT ANY
# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
# A PARTICULAR PURPOSE. See the GNU Affero General Public License for more
# details.
#
# You should have received a copy of the GNU Affero General Public License along
# with this program. If not, see <http://www.gnu.org/licenses/>.
#
class GranularManageGroupsPermissions < ActiveRecord::Migration[6.0]
tag :postdeploy
def change
DataFixup::AddRoleOverridesForNewPermission.run(:manage_groups, :manage_groups_add)
DataFixup::AddRoleOverridesForNewPermission.run(:manage_groups, :manage_groups_manage)
DataFixup::AddRoleOverridesForNewPermission.run(:manage_groups, :manage_groups_delete)
end
end