How do I remove any "override permissions" and reset them to default

How do I remove any "override permissions" and reset them to default

by Peter Evans -
Number of replies: 7

I have been trying various combinations of "overrider  permissions to allow things like:

  • guests to be able to view the course and the forums
  • but enrolled users to download files

Turns out that it is not as easy as I hoped.

How can I find out the default permissions or capabilities and reset them all to the default values?

Peter Evans

Average of ratings: -
In reply to Peter Evans

Re: How do I remove any "override permissions" and reset them to default

by Steve Hyndman -

That's a great question. I'm looking forward to hearing the answer as well.

Steve

In reply to Peter Evans

Re: How do I remove any "override permissions" and reset them to default

by John Isner -
If you made these changes with overrides (as your post indicates), remove the overrides. To do this, go to the Override permissions tab in the context where you made each override, look for roles with a non-zero number of overrides, click on those and make sure all the radio buttons are set to Inherit. This will set the count back to zero.

If you edited predefined roles (like Guest, Teacher, Student), go to Site administration -> Users -> Permissions -> Define roles, click on each role you changed, and press the Reset to defaults button.

When everything is back to normal, post again telling us what you're trying to do and Steve and I will give you suggestions smile
In reply to John Isner

Re: How do I remove any "override permissions" and reset them to default

by Steve Hyndman -

"...Steve and I will give you suggestions"

Okay...I had a second site admin make a bunch of overrides in courses and make a bunch of changes to predefined roles thinking he knew what he was doing. I don't know what he did and he doesn't remember everything. How do I set everything back to the default state? It's my production site and strange things are happening.

Disclaimer...of course, this is all hypothetical...I don't really have this problem, but I can see how someone could and I assumed the OP doesn't remember all the role changes he made and was simply wanting to know how to return his site to its "default" state.

EDIT: Oh...you were telling the OP that once he got everything back to normal that you AND I would give him suggestions...I'm a little slow this morning. I do appreciate your vote of confidence, but I'll leave solutions for "all things roles" to you and I'll just continue to be the critic smile.  

Steve

In reply to Steve Hyndman

Re: How do I remove any "override permissions" and reset them to default

by John Isner -
Steve and OP,
if you want to set everything back to factory defaults, you follow the procedure I gave. If you want to go back to what you had before you started fiddling, you're up the creek unless you kept good records.

The second scenario is more realistic. Any site that has been using roles actively will have made a lot of changes that they would want to preserve. Setting everything back to factory defaults is not an option.

There are currently no tools in the standard distribution for reporting and tracking changes to roles (see MDL-13228). Until this is remedied, administrators should keep careful notes of everything they do related to roles.
In reply to Peter Evans

Re: How do I remove any "override permissions" and reset them to default

by Christopher Ross -
Is there an SQL command I could run or something in the admin to reset all the permissions back instead of going through each page?
In reply to Christopher Ross

Re: How do I remove any "override permissions" and reset them to default

by Tim Hunt -
Picture of Core developers Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers
Find the context id of the site context, which will almost certainly be 1. Then do

DELETE FROM mdl_role_capaiblities WHERE contextid <> 1;

That will remove all role overrides from your site, so be very sure that is what you want to do.

To reset the definitions of all the roles back to default, use the option on the role editing page.
In reply to Peter Evans

Re: How do I remove any "override permissions" and reset them to default

by Martin V -
If I understand correctly, the dark grey shading of settings in Admin:Users:Permissions:Define Roles and white shading in Admin:Front Page:Front Page Roles indicates the default settings, and in the latter no special background means the permission was 'not assigned'.

At first glance that seems to be the case, but there are discrepancies. For example, regarding a non-editing teacher, the role definitions for gradebooks are 'not set' for "Import grades from CSV" and for "Import grades from XML", but in the front page roles both have white fields suggesting that "allow" is the default.

Have I misunderstood something?

Martin