Issue Details (XML | Word | Printable)

Key: MDL-17267
Type: Sub-task Sub-task
Status: Resolved Resolved
Resolution: Fixed
Priority: Major Major
Assignee: Petr Skoda
Reporter: Petr Skoda
Votes: 0
Watchers: 1
Operations

Add/Edit UI Mockup to this issue
If you were logged in you would be able to see more operations.
Moodle
MDL-17268

create_role is too clever - sets allow role assign and override for all admin accounts

Created: 18/Nov/08 06:55 PM   Updated: 18/Jan/09 08:24 AM
Component/s: Roles
Affects Version/s: 2.0
Fix Version/s: 2.0

Participants: Petr Skoda and Tim Hunt
Security Level: None
Resolved date: 18/Jan/09
Affected Branches: MOODLE_20_STABLE
Fixed Branches: MOODLE_20_STABLE


 Description  « Hide
The problem is that the roles installation was duplicating the records - install was failing for me because it was creating duplicates in allow role assign table

I believe that hacks like this should not be done at the lowest level, instead they should be moved much closer to UI code

committing patch that comments out the second allow role assign and override from moodle_install_roles()

 All   Comments   Change History   Version Control      Sort Order: Ascending order - Click to sort in descending order
Petr Skoda added a comment - 18/Nov/08 07:14 PM
Linking with refactoring required for Moodle External API

Solution could be:

  • create new function allow_admins_override_and_assign($roleid) // TODO: needs some better name
  • call it from roles UI when crating new role
  • call it from restore when adding new role

Tim Hunt added a comment - 19/Nov/08 09:40 PM
Actually, Petr, an alternative approach would be to change get_assignable/overridable roles, so that the fact that people with doanything can assign or override any role does not need to be stored in the DB. If you want me to do that, feel free to assign this bug to me.

Petr Skoda added a comment - 19/Nov/08 10:26 PM
yes Tim, I like that approach
my +2 for head

Petr Skoda added a comment - 18/Jan/09 08:24 AM
implemented, please review