Adding many users to a view-only system level role (3.9.2)

Adding many users to a view-only system level role (3.9.2)

by Charles Roper -
Number of replies: 3

Hi,

We've been scratching our heads trying to solve a problem and haven't come up with a satisfactory solution, so asking the community here how you might solve it.

Here's the requirement: we need to grant all users of a certain type (education staff) view-only access to all courses. A sub-requirement is to grant some users (e.g. external education staff) view-only access to courses in a category, but I know how to make roles assignable to a context so we don't need to cover that further.

The users are grouped using cohorts.

Questions:

  1. What is the best way to make a "view-only" role? Is there guidance or an archetype to use? The role should be able to browse categories, see courses they are not enrolled in, and the content of those courses. They should not be able to edit or interact with those courses. There are so many permissions I don't know where to start!
  2. How do we add a group of users (e.g., all the users in a cohort) to a role? Can a cohort group be assigned to a role (I think not having done some searching). Can it be done via bulk spreadsheet upload? Is there a plugin? Or some other way to do it built in? I can't find a way of doing this other than by adding the users to the role one by one. I don't want to bulk enrol the users on to the courses because I don't want them to appear in the participants list. This seems like an obvious task, but no obvious way to do it. We are comfortable writing SQL if necessary.
I had hoped the "assign user roles to cohorts" feature would be of help here, but we got confused in exactly the same way as Derek in this thread and concluded it's not of use here after all.

Any help or advice warmly received.

Many thanks,
Charles
Average of ratings: -
In reply to Charles Roper

Re: Adding many users to a view-only system level role (3.9.2)

by Randy Thornton -
Picture of Documentation writers
Charles

Take a look at the "Observer" role that Howard Miller has created: https://moodle.org/mod/forum/discuss.php?d=384769#p1551220 and https://moodle.org/mod/forum/discuss.php?d=407003#p1642734. That will be a good starting point for your role.

Yes, you can do this using a spreadsheet upload. You can assign any system level role in bulk using the User upload tool, details here: https://docs.moodle.org/39/en/Upload_users#Set_system_roles. For example, for the observer role, with a shortname of "observer", you would simply fill in the column headed sysrole1 with a value of "observer" for every row / user you need to set.

Randy
Average of ratings: Useful (1)
In reply to Randy Thornton

Re: Adding many users to a view-only system level role (3.9.2)

by Charles Roper -
Thank you Randy, I really appreciate the response. This looks like just the ticket. Many thanks.

Charles
In reply to Charles Roper

Re: Adding many users to a view-only system level role (3.9.2)

by Randy Thornton -
Picture of Documentation writers
Most welcome. The user upload tool can do a lot more than upload new users smile