Copy user (role) permissions from one course to another

Copy user (role) permissions from one course to another

by Terry Aulenbach -
Number of replies: 4
(Moodle 3.3.4+)

We have a small number of courses that require a large amount of permissions editing to prevent students and other roles from seeing information they would normally see (e.g. other students). It quite literally takes hours to remove all the permissions. Is there any way to make a copy of a course that includes all these permissions changes? Or even a way to completely remove a role's access from a course or set all the permissions to prohibit? These courses have very sensitive information and I need to be sure it can't be accessed by almost all roles.


Average of ratings: -
In reply to Terry Aulenbach

Re: Copy user (role) permissions from one course to another

by Ryan Hazen -

I would copy the course without user data then use a csv to enroll users without the additional permissions. Currently there's not a good way to remove roles via csv (that I know of) but if you copy the course, then enroll users with a csv you can only give them the student role without all the additional permissions you mention. 

csv upload instructions here. enroll with a "course1" column and set role with "role1" column with value "student" for everyone.

In reply to Ryan Hazen

Re: Copy user (role) permissions from one course to another

by Terry Aulenbach -

Unfortunately, that only seems to work at the system level rather than at a course level. So far the best solution I have found is to create a new system-level role, set the rights for that role, and then change the students' roles to that new role. Not ideal (especially since our registrations are automatic), but better than the alternative. It also requires me to change a course setting to prevent role updates.

In reply to Terry Aulenbach

Re: Copy user (role) permissions from one course to another

by Ryan Hazen -

Sounds like your problem is external to Moodle. If using LDAP, for example, you should be able to set up the groups such that your users are enrolled with student role rather than the custom role you have set up. 

It may also be that you modified the student role rather than creating a new custom role for those instances where you need students to have more permissions. If that's the case, copy the student role, save it as a new role, then revert the original student role to defaults. 

The first suggestion I made above would solve the problem in bulk, but would require you to do that manual process for each new course.