moodle-an-hochschulen / moodle-local_bulkenrol

Moodle plugin which provides the possibility to bulk enrol a list of users who are identified by their e-mail adresses into a course.
5 stars 17 forks source link

Manager do not have cap local/bulkenrol:enrolusers #24

Closed lucaboesch closed 3 years ago

lucaboesch commented 3 years ago

Hi.

I suppose since in db/access.php no archetypes are defined, managers can't use the bulkenrol tool.

Probably adding

        'archetypes' => array(
            'editingteacher' => CAP_ALLOW,
            'manager' => CAP_ALLOW
        ),

would fix that.

Best, Luca

abias commented 3 years ago

Hi Luca,

thank you for raising this issue!

If you look at https://github.com/moodleuulm/moodle-local_bulkenrol#capabilities, you will see:

By default, Moodle users are not allowed to use the functionality provided by this plugin. As administrator, you can selectively grant users the ability to use this functionality by adding the local/bulkenrol:enrolusers capability to an appropriate Moodle role.

We built it that way by purpose as we thought that not every teacher should be able to use the bulk enrolment tool just by installing this plugin. The admin should think first which role should be able to use this tool or not.

However, I would agree that managers could / should be able to use this tool by default.

Would it be ok for you if I just added the manager archetype to db/access.php, but not the editingteacher archetype?

Cheers, Alex

lucaboesch commented 3 years ago

Dear Alex

Yes, sure. That's exactly the spirit. The editingtecher has to be 'unlocked' with purpose. But manager should get the cap automatically.

My code should have looked like this


'archetypes' => array(
            'manager' => CAP_ALLOW
        ),        

Best, Luca

abias commented 3 years ago

Thank you, Luca.

This has been implemented now in 8a7a585.

Cheers, Alex