Esempio n. 1
0
def on_module_enabled(courses_custom_module, course_permissions):
    global custom_module  # pylint: disable=global-statement
    custom_module = courses_custom_module

    course_permissions.append(roles.Permission(
        constants.TEACHING_ASSISTANT_PERMISSION,
        'Can modify assessment due dates and scoring.'))

    permissions.SchemaPermissionRegistry.add(
        constants.SCOPE_ASSESSMENT,
        permissions.SimpleSchemaPermission(
            custom_module, constants.TEACHING_ASSISTANT_PERMISSION,
            readable_list=[
                'assessment/type',
                'assessment/title',
                'assessment/description',
                ],
            editable_list=[
                'assessment/%s' % resources_display.workflow_key(
                    courses.SINGLE_SUBMISSION_KEY),
                'assessment/%s' % resources_display.workflow_key(
                    courses.SUBMISSION_DUE_DATE_KEY),
                'assessment/%s' % resources_display.workflow_key(
                    courses.SHOW_FEEDBACK_KEY),
                'assessment/%s' % resources_display.workflow_key(
                    courses.GRADER_KEY),
                'review_opts/%s' % resources_display.workflow_key(
                    courses.MATCHER_KEY),
                'assessment/%s' % resources_display.workflow_key(
                    courses.REVIEW_DUE_DATE_KEY),
                'assessment/%s' % resources_display.workflow_key(
                    courses.REVIEW_MIN_COUNT_KEY),
                'assessment/%s' % resources_display.workflow_key(
                    courses.REVIEW_WINDOW_MINS_KEY),
                ]))
Esempio n. 2
0
def on_module_enabled(courses_custom_module, course_permissions):
    global custom_module  # pylint: disable=global-statement
    custom_module = courses_custom_module

    course_permissions.append(
        roles.Permission(constants.TEACHING_ASSISTANT_PERMISSION,
                         'Can modify assessment due dates and scoring.'))

    permissions.SchemaPermissionRegistry.add(
        constants.SCOPE_ASSESSMENT,
        permissions.SimpleSchemaPermission(
            custom_module,
            constants.TEACHING_ASSISTANT_PERMISSION,
            readable_list=[
                'assessment/type',
                'assessment/title',
                'assessment/description',
            ],
            editable_list=[
                'assessment/%s' %
                resources_display.workflow_key(courses.SINGLE_SUBMISSION_KEY),
                'assessment/%s' % resources_display.workflow_key(
                    courses.SUBMISSION_DUE_DATE_KEY),
                'assessment/%s' %
                resources_display.workflow_key(courses.SHOW_FEEDBACK_KEY),
                'assessment/%s' %
                resources_display.workflow_key(courses.GRADER_KEY),
                'review_opts/%s' %
                resources_display.workflow_key(courses.MATCHER_KEY),
                'assessment/%s' %
                resources_display.workflow_key(courses.REVIEW_DUE_DATE_KEY),
                'assessment/%s' %
                resources_display.workflow_key(courses.REVIEW_MIN_COUNT_KEY),
                'assessment/%s' %
                resources_display.workflow_key(courses.REVIEW_WINDOW_MINS_KEY),
            ]))
Esempio n. 3
0
def on_module_enabled(courses_custom_module, course_permissions):
    global custom_module  # pylint: disable=global-statement
    custom_module = courses_custom_module

    course_permissions.append(roles.Permission(
        constants.TEACHING_ASSISTANT_PERMISSION,
        'Set unit availability and grading.  '
        'Suitable for teaching assistants.'))

    # Roles with TA permission can edit course availability, start/end dates.
    permissions.SchemaPermissionRegistry.add(
        constants.SCOPE_COURSE_SETTINGS,
        permissions.SimpleSchemaPermission(
            custom_module, constants.TEACHING_ASSISTANT_PERMISSION,
            editable_list=[
                'course/course:start_date',
                'course/course:now_available',
                'course/course:browsable',
                ]))

    # Roles with TA permission can edit unit availability, start/end dates.
    permissions.SchemaPermissionRegistry.add(
        constants.SCOPE_UNIT,
        permissions.SimpleSchemaPermission(
            custom_module, constants.TEACHING_ASSISTANT_PERMISSION,
            readable_list=[
                'type',
                'title',
                'description',
                ],
            editable_list=[
                'is_draft',
                'shown_when_unavailable',
                ]))
    permissions.SchemaPermissionRegistry.add(
        constants.SCOPE_LINK,
        permissions.SimpleSchemaPermission(
            custom_module, constants.TEACHING_ASSISTANT_PERMISSION,
            readable_list=[
                'type',
                'title',
                'description',
                ],
            editable_list=[
                'is_draft',
                'shown_when_unavailable',
                ]))
    permissions.SchemaPermissionRegistry.add(
        constants.SCOPE_ASSESSMENT,
        permissions.SimpleSchemaPermission(
            custom_module, constants.TEACHING_ASSISTANT_PERMISSION,
            readable_list=[
                'assessment/type',
                'assessment/title',
                'assessment/description',
                ],
            editable_list=[
                'assessment/is_draft',
                'assessment/shown_when_unavailable',
                'assessment/%s' % resources_display.workflow_key(
                    courses.SINGLE_SUBMISSION_KEY),
                'assessment/%s' % resources_display.workflow_key(
                    courses.SUBMISSION_DUE_DATE_KEY),
                'assessment/%s' % resources_display.workflow_key(
                    courses.SHOW_FEEDBACK_KEY),
                'assessment/%s' % resources_display.workflow_key(
                    courses.GRADER_KEY),
                'review_opts/%s' % resources_display.workflow_key(
                    courses.MATCHER_KEY),
                'assessment/%s' % resources_display.workflow_key(
                    courses.REVIEW_DUE_DATE_KEY),
                'assessment/%s' % resources_display.workflow_key(
                    courses.REVIEW_MIN_COUNT_KEY),
                'assessment/%s' % resources_display.workflow_key(
                    courses.REVIEW_WINDOW_MINS_KEY),
                ]))