Duplicating role not working

Duplicating role not working

by Javier Tejera -
Number of replies: 8

I was trying to figure out what I am doing wrong, but I can’t find the answer. Here is the context:

 I have two different students in my Moodle 3.4: (A) and (B). The difference between them is as follows:

(A)   Student role

(B)   Student role + view hidden categories capability

I proceed to duplicate the student role in order to create a new role for the (B). Then I check the courses but I can see that capabilities and permissions are not actually being duplicated. You can see in the next picture that the new role is not appearing but the (A) one it does ("Student").



 

Do you have any idea what I am doing wrong? Many thanks in advance.


Average of ratings: -
In reply to Javier Tejera

Re: Duplicating role not working

by Howard Miller -
Picture of Core developers Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers

To whom and at what context are you assigning this new role?

In reply to Howard Miller

Re: Duplicating role not working

by Javier Tejera -

Thanks for your help. None of the solutions are working - I guess I am doing something wrong with a really simple solution...

These are all the steps I am following:

Site administration > users > permissions >  define roles > Add a new role

When adding a new role:
User role or archetype: “Student”
Context types where this role may be assigned (all of them): “system, user, category, course, activity module and block”.

Once this role is created: 
Course > course administration > users > enrolled users > enrol users
Here I select a cohort (30 people) and assign the role of the previous point.

Now, when the students of this cohort log in to the course, the activities are not set with student permissions. For instance, they don't have permission to see a forum.

Any suggestion?

In reply to Javier Tejera

Re: Duplicating role not working

by Colin Fraser -
Picture of Documentation writers Picture of Testers

This line:

 "Context types where this role may be assigned (all of them): “system, user, category, course, activity module and block”."

Personally, I would only select "course" that way it can never be misassigned. 

In reply to Colin Fraser

Re: Duplicating role not working

by Mary Cooch -
Picture of Documentation writers Picture of Moodle HQ Picture of Particularly helpful Moodlers Picture of Testers Picture of Translators

If you want to give Student B the hidden categories capability you are going to have to give them the role in the system context as well as course context because categories are beyond courses, so you will have to assign the relevant students the role in the system. See Creating custom roles

In reply to Mary Cooch

Re: Duplicating role not working

by Colin Fraser -
Picture of Documentation writers Picture of Testers

Quite right Mary, but for me, I would never create a new student role for anything other than a course, it gets too messy. What others do, is of course up to them, but for me, keep everything as simple as possible, fewer headaches..cool

In reply to Colin Fraser

Re: Duplicating role not working

by Javier Tejera -
So, here is the point:


The students (A) are actually external students of my institution, and the students (B) are the paid staff (in-house) of my institution.

I don't want that (A) can see the courses of (B) for obvious reasons. For me this is not a problem, but the director is insisting so much on this point.

Having introduced this context, what can be the best suitable solution?


In reply to Javier Tejera

Re: Duplicating role not working

by Colin Fraser -
Picture of Documentation writers Picture of Testers

The image is not really that helpful actually. First, when cloning a Role, make sure it has a really different name, I know simple but you might be surprised. Calling the new Role StudentB or some such is not always helpful try something like HiddenStu, something that connects the capability change to what the changed name is.  Second, if you haven't assigned the Role to Student B properly, it won't work. They are the only two reasons I am aware of as to why a Role change will not work when you change permission sets. Go to the Category or Course you want that Role to be used and make sure that Student B has been assigned that Role.    

In reply to Colin Fraser

Re: Duplicating role not working

by Mary Cooch -
Picture of Documentation writers Picture of Moodle HQ Picture of Particularly helpful Moodlers Picture of Testers Picture of Translators

Try ticking the new role in Site policies>Profile visible roles and if that doesn't work try ticking the new role in Site admin>Grades>General settings