Defining a Role to Disable My Moodle Block Editing

Defining a Role to Disable My Moodle Block Editing

by Deb Burdick-Hinton -
Number of replies: 11

Greetings Moodlers ....been out of the moodle.org zone for a while but am back with a vengence...er...passion!

Just starting to dabble in roles, so appreciate your patience.

We are a post secondary training institution but are helping out the local middle school (kids age 12-14ish)  by allowing them access to one of our courses. We have "Online User" and "Message" available for students to access on their My Moodle page. We decided to create a MS Student Role.  Our objective is to "Not Allow" MS Student to edit the blocks on their "My Moodle" page but allow all other students, teachers, course creators....basically everyone else. So I did a little homework on moodle.org and thought we had all our ducks in a row but we had numerous challenges, did more research, recreated the roles adjusted some settings in the Admin>Appearance>course mgrs so the new role would show up, experimented with duplicating the student role vs creating a new role based on Legacy-student but each had its own challenges.

So I would like advice on what steps I should take in creating the role identical to the student role but without permission to edit blocks on "My moodle" and also make sure the role shows up in the course.

Thank you Thank you in advance!

Average of ratings: -
In reply to Deb Burdick-Hinton

Re: Defining a Role to Disable My Moodle Block Editing

by Helen Foster -
Picture of Core developers Picture of Documentation writers Picture of Moodle HQ Picture of Particularly helpful Moodlers Picture of Plugin developers Picture of Testers Picture of Translators

Hi Deb,

Nice to see you around on moodle.org again. smile

To achieve what you describe, you need to create a new role, say "Non-editing My Moodle" with the capability moodle/my:manageblocks set to prevent. (All other capabilities can be left unset.) You then need to assign your MS students this role in the system context (i.e. as a system role) as well as assigning them the role of student in their course.

The reason for needing to give your MS students more than one role is that the MyMoodle feature is outside courses and so the capability moodle/my:manageblocks only works for system roles. Within their course, MS students should be able to do all the same stuff as other students  so you can simply assign them the same role.

Average of ratings: Useful (1)
In reply to Helen Foster

Re: Defining a Role to Disable My Moodle Block Editing

by Trish Hart -

Hi Helen, thanks for the response.  I am working with Deb.  I created a new role...no legacy as Non-Edit My Moodle and have everything at not set except manageblocks set to prevent.   I asigned my test student to the system role of Non-Edit my Moodle and in the course my test student in the Student role

But....they can still edit the block.  I'm still missing something sad  Any other ideas?

Thanks so much!!

In reply to Trish Hart

Re: Defining a Role to Disable My Moodle Block Editing

by Helen Foster -
Picture of Core developers Picture of Documentation writers Picture of Moodle HQ Picture of Particularly helpful Moodlers Picture of Plugin developers Picture of Testers Picture of Translators

Hi Trish,

I've just tried and found the same as you, that the student can still edit the block! I was wrong in saying that the capability moodle/my:manageblocks should be set to prevent - it should be set to prohibit. Apologies for the misleading info. blush Hope you can get things working correctly now.

In reply to Helen Foster

Re: Defining a Role to Disable My Moodle Block Editing

by Trish Hart -

Hello Helen

That worked Beautifully!!  Thank you so much for your expertise!

Trish Hart

In reply to Helen Foster

Re: Defining a Role to Disable My Moodle Block Editing

by Trish Hart -

Hi Helen, Maybe you or some other amazing moodler out there can help me with this role.  I did some research and can't seem to find a definite answer.

I have 1 teacher that I would like to allow add new users.  I created a Add-User_Teacher role with legecy of Teacher.  She is assigned teacher in course but Add-User-Teacher on site.  Now, using My Moodle, how do i allow her to see the admin block so she can add new users......

Trish Hart-who is forever greatful for the amazing moodlers out here!

In reply to Trish Hart

Re: Defining a Role to Disable My Moodle Block Editing

by Trish Hart -

Hi moodlers smile  Does anyone have an idea on how I can get a teacher the ability to see the admin block to add new users when using my moodle?  1.9x  Thanks for the info!

In reply to Trish Hart

Re: Defining a Role to Disable My Moodle Block Editing

by Elena Ivanova -

Hi Trish,

Have you also provided that new role some extra capabilities?
Go to *Administration >  Users >  Permissions > Define roles. Click on your new Add-User_Teacher role.

Review what is there under System header.

You would probably want to set those to Allow

  • Upload new users from file
  • Create users
  • Delete users
  • Update user profiles
In reply to Elena Ivanova

Re: Defining a Role to Disable My Moodle Block Editing

by Trish Hart -

Spa-Se-va Elana for getting back to me smile

Yes if you look at prior post, I have the role all set up just the issue with the admin block showing so the Add-User Teacher can actually add users.  Since we use My Moodle, they can not see the block. 

Any thoughts on that? 

In reply to Trish Hart

Re: Defining a Role to Disable My Moodle Block Editing

by Elena Ivanova -

Oh, I see smile

Go to myMoodle page, click 'Edit this page' button  in the upper right corner. Add Site Adminsitration Block to the page.

In reply to Elena Ivanova

Re: Defining a Role to Disable My Moodle Block Editing

by Trish Hart -

Unfortunately Site Admin is not listed in the blocks

In reply to Trish Hart

Re: Defining a Role to Disable My Moodle Block Editing

by Elena Ivanova -

hmm. Sorry, not sure why. sad

I have looked at 1.9.8 and a.9.5 - I see it there.  Are you logged in as full admin? Admin has to add this block, and then others would be able to use it.

Update: I take it back. I have added it as an admin, but support user cannot see it there, and can see it only on the regular moodle homepage.
hmmm, can your support user navigate to a homepage instead, from myMoodle, by erasing /my in the URL? Or do you force people to go there?