Automating Assignment to Custom System Role

Automating Assignment to Custom System Role

by Chris Chapman -
Number of replies: 8

Hi as the title suggests, I've created a custom 'Staff' System role, which allows basic read access to all courses. Is there any way to automate assigning this role? LDAP, CSV import? We have about 1000 staff and constant new starters, so would be a big pain if I had to assign them all manually, please help!

This will be on a Moodle 2.6 system, with LDAP and SSO. 

Many Thanks,

 

Average of ratings: -
In reply to Chris Chapman

Re: Automating Assignment to Custom System Role

by Catherine Pinnell -

Hi, I have been trying to research this question, and have experienced trouble getting straightforward directions on it. From everything I read, it should be possible, but what is the magic that takes an AD group (LDAP Authentication) and assigns that group to a specific role that you have created in Moodle?

I have the groups in AD. I have the roles in Moodle. Let's introduce them so they can go on a date. ;)


In reply to Catherine Pinnell

Re: Automating Assignment to Custom System Role

by Jinxing Chen -

I got same problem.

Map role from LDAP doesn't work. I wish someone has some ideas.

In reply to Chris Chapman

Re: Automating Assignment to Custom System Role

by Frances Angulo -

I have a similar challenge, I thought that if I searched for all users with @companyname in the domain, that I could at leaf get existing users in to the right roles- but it doesn't appear to be a bulk user action. 

In reply to Frances Angulo

Re: Automating Assignment to Custom System Role

by Catherine Pinnell -

Hi everyone, I think I have found a great lead! I have not installed or tested this  plug-in yet, but this is the route we are going to try:

https://moodle.org/plugins/view.php?plugin=local_cohortrole

From what I can see, it will answer the questions at least I have. I hope this helps you all too!

In reply to Catherine Pinnell

Re: Automating Assignment to Custom System Role

by Jinxing Chen -

Thanks Catherine

Our Moodle version is V2.7, currently the plugin only support up to 2.6. I will download it and try on our dev server for testing any way.

Thanks for sharing this, I wish it will working for 2.7.

In reply to Jinxing Chen

Re: Automating Assignment to Custom System Role

by Catherine Pinnell -

Jinxing, 

We are also on version 2.7, so I will be sure to share the results. Let's hope for the best. smile

In reply to Catherine Pinnell

Re: Automating Assignment to Custom System Role

by Catherine Pinnell -

The aforementioned plug-in works in Moodle 2.7 from what I can see. I have not performed extensive testing. Once installed, the menu for the plug in appears in Site Administration -> Users -> Cohort role synchronization.

You must have site-wide roles set up in order for this sync to work. I'm not sure if that will meet your needs, but it meets mine. It is very simple - you pick the cohort and then pick a role to assign. If you need to tweak your roles, there is pretty good documentation in Moodle Docs on that. 

I hope this helps others assign roles with greater ease.

Average of ratings: Useful (1)
In reply to Catherine Pinnell

Re: Automating Assignment to Custom System Role

by Paul Holden -
Picture of Core developers Picture of Moodle HQ Picture of Moodle Workplace team Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers Picture of Testers

Hi Catherine & Jinxing, thanks for confirming the plugin works in Moodle 2.7 approve

Hopefully your testing went well - please report anything that doesn't seem to be functioning properly in this version!