Skip to content

Allow Instance Admin and Instance Instructor to Duplicate Courses across Instances#7095

Merged
ekowidianto merged 4 commits into
masterfrom
bivan/instance_user_duplicate_course
Mar 4, 2024
Merged

Allow Instance Admin and Instance Instructor to Duplicate Courses across Instances#7095
ekowidianto merged 4 commits into
masterfrom
bivan/instance_user_duplicate_course

Conversation

@bivanalhar
Copy link
Copy Markdown
Contributor

Background

Previously, only administrator of Coursemology can do the duplication of course between instances, while other people having privileges in duplicating the course can only do that within the instance they're in.

Objective

In this PR, we decided to allow the instance instructor as well as instance admin to duplicate courses within their instance. The rulings that we apply are as follows:

  • In the source instance, the user doing the duplication should be either instance instructor or instance admin
  • The same should go for the destination instance

Result

As shown below, if user is at least instance instructor in the instance Default and Raffles Institution, those 2 options will be available in the Duplication Page, in the Destination Instance section
Screenshot 2024-02-07 at 1 22 20 AM

On the other hand, if a user is only the instance admin/instructor in one instance (and either instance normal or none in other instances), then the option for Destination Instance will be fixed and user will not be able to modify it
Screenshot 2024-02-07 at 1 23 40 AM

- allow instance instructor and instance admin to duplicate across instances
- the user duplicating should not be instance normal for both instances
@bivanalhar bivanalhar force-pushed the bivan/instance_user_duplicate_course branch from 75a4a87 to 0b1f1e2 Compare February 6, 2024 17:26
- test duplication feasibility across instances
- test instances and courses list for controller new in duplication
@bivanalhar bivanalhar force-pushed the bivan/instance_user_duplicate_course branch from a009ad0 to 820a8f9 Compare February 8, 2024 05:46
Copy link
Copy Markdown
Member

@ekowidianto ekowidianto left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks! @bivanalhar some comments

Comment thread app/controllers/course/duplications_controller.rb Outdated
Comment thread app/controllers/course/duplications_controller.rb Outdated
Comment thread app/views/course/object_duplications/new.json.jbuilder Outdated
Comment thread app/models/components/course/duplication_ability_component.rb
Comment thread app/controllers/course/object_duplications_controller.rb
- define destination_tenant more clearly
- split admin user from others in destination instance logic
- take out business logic for instance dropdown in backend
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants