admin capabilities lost after changes to authorized user system setting

admin capabilities lost after changes to authorized user system setting

by Natalio Simon -
Number of replies: 3

Hallo

After installing and using moodle for 2 weeks, I wanted to restrict what 'authorized users' can do. I changed most of the settings of the system role 'authorized user' to Prevent, since these options I wanted to restrict to 'teachers' and 'administratitor'. When I clicked on 'Save' and error was returned.

Now when I log in as 'admin', I do not get any administrator or editing opties.

Any idea how to rol back to normal. Any way to restore the settings in the file/databses or other solutions.

I already tried the script

adminfix.php

which sets the default settings to all roles but the ploblems remains.

We are suppose to go to production this week but now nobody can edit anything.

Thanks in advance.

Natalio

Average of ratings: -
In reply to Natalio Simon

Re: admin capabilities lost after changes to authorized user system setting

by Natalio Simon -
Well, the experts did not reply, so we had to solve the problem ourself (I could not get my money back anyway).
I had to inspect the mysql database (using phpMyAdmin). Then I saw that the table
mdl_role_capability had entries for roleid 7 (authorized user) with permission -1 (prevent), which is the last thing I did. The permissions for roleid 1 (admin) where under. I assume there is a bug that prevents the system to reach the admin permissions when you (certain) change permissions of another role (at least of role authorized user). I removed all the roleid 7 entries with permission -1 which I had done via the moodle interface and that solved the problem. It seems that the entries are only added when you override the standard setting, so removing them causes not harm (I hope).
Average of ratings: Useful (1)
In reply to Natalio Simon

Re: admin capabilities lost after changes to authorized user system setting

by Mink mink -
Thank You very much for sharing your experience here. I have the same problem but nothing was of help till I came across your entry. I almost gave up! thanks again.big grin
In reply to Natalio Simon

Re: admin capabilities lost after changes to authorized user system setting

by Tonia Dousay -

After six months of scratching my head and trying adminfix.php and lost.php scripts to restore admin rights, Natalio's post put me on the right track. The code fixes recommended were only allowing partial restore (ability to edit the front page).

I was able to comb through the mdl_role_* tables and finally found the two entries on the admin userid that were causing the override (were not set to roleid 1) worked. I logged out of the admin account, logged back in and permissions had been restored. I was then able to go into Site Admin > Users and correct the override that was affecting my co-administrators.