General developer forum

Restriction by authentication type

 
Picture of Ali Rajabpour Sanati
Restriction by authentication type
 

Hello all;

I need to restrict my users access to course contents based on their authentication type (manual, LDAP and so on). I think it would be possible to do that by modifying this module that is written by Alexander Bias. The problem is that I am a newbie in PHP and I don't know what changes I need to make. Please help me.

Thank you.

 
Average of ratings: -
Picture of Darko Miletić
Re: Restriction by authentication type
Core developersParticularly helpful Moodlers

Keep it simple. For each different auth plugin create a separate role. Ensure that ldap users have special ldap role, manual users have special manual role etc. That way you just use the existing plugin as is.

 
Average of ratings: Useful (1)
Picture of Ali Rajabpour Sanati
Re: Restriction by authentication type
 

Thank you Darko for your help. Would you please tell how can I do that?

When I want to define a new role there is no option to create role based on the authentication types. I have 12799 users that increase almost every day and I need to roles assign automatically as a user joins the moodle.

Thank you in advance.

 
Average of ratings: -
Picture of Darko Miletić
Re: Restriction by authentication type
Core developersParticularly helpful Moodlers

You can try this plugin

https://moodle.org/plugins/enrol_attributes


Supposedly if you set user profile attributes they can be used to determine role by which user is enrolled into course.

 
Average of ratings: -