Roles assignment in the DB

Roles assignment in the DB

by Ian Scott -
Number of replies: 4

I've been having upgrade problems which seems to be roles have not been assigned/created properly - as an admin I'm locked out.

I've looked into the DB and looking at the various tables and I think role number 13 should be an administrator - is there a way I can manually create/check the role assignment? Any ideas why moodle does allow me to act as an admin?

User Table

mdl_user

id

auth

confirmed

policyagreed

deleted

username

password

idnumber

firstname

lastname

email

emailstop

icq

skype

yahoo

aim

msn

phone1

phone2

institution

department

address

city

country

lang

theme

timezone

firstaccess

lastaccess

lastlogin

currentlogin

lastip

secret

picture

url

description

mailformat

maildigest

maildisplay

htmleditor

ajax

autosubscribe

trackforums

timemodified

trustbitmask

13

manual

1

0

0

ian

SACSnet

Administrator

iscott@sacs.nsw.edu.au

0

Sydney

AU

en_utf8

99

0

1164759201

1164757768

1164759195

10.0.5.201

1

1

0

1

1

1

1

0

1140672224

0

mdl_role_capabilities

id

contextid

roleid

capability

permission

timemodified

modifierid

1

1

1

moodle/legacy:admin

1

1164756643

0

mdl_role_assignments

id

roleid

contextid

userid

hidden

timestart

timeend

timemodified

modifierid

enrol

sortorder

1

1

1

13

0

0

0

1164756644

0

manual

0

mdl_role

id

name

shortname

description

sortorder

1

Administrator

admin

Administrators can usually do anything on the site, in all courses.

0

mdl_access_owner

id

fkid

description

designee

designee_type

designee_description

timecreated

timemodified

1

1

repository_file

13

1

1147742976

1147742976

Average of ratings: -
In reply to Ian Scott

Re: Roles assignment in the DB

by Yu Zhang -
Hi,

You should check the
moodle/site:doanything capability. Also please check what's in your context table (id1).

The last table is not relevant, I think.

Cheers,

Yu
In reply to Yu Zhang

Re: Roles assignment in the DB

by Ian Scott -

Where do I find the moodle/site:doanything capability?

as to the context I have

mdl_context id contextlevel instanceid 1 10 1

In reply to Ian Scott

Re: Roles assignment in the DB

by Ian Scott -

Fixed now - simply waited till patches fixed on moodle - shows the importance of never upgrading a production site till throughly tested

In reply to Ian Scott

Re: Roles assignment in the DB

by Luc Lecroisey -
I had the same problem and i have reinstalled the latest 1.7.1+ and the problem is always the same. The only difference between the case of Ian Scott and me is that i have an external (ldap) authentication which send to moodle the username and the MD5Password from Drupal.

Regards,

Loutcholycos