Moodle

Inconsistent behavior when (a) modifying a legacy role (b) defining a new role inherited from legacy role

Details

  • Type: Bug Bug
  • Status: Closed Closed
  • Priority: Minor Minor
  • Resolution: Not a bug
  • Affects Version/s: 1.8
  • Fix Version/s: None
  • Component/s: Roles / Access
  • Labels:
    None
  • Environment:
    Tested on demo.moodle.org on March 11, 2007
  • Affected Branches:
    MOODLE_18_STABLE

Description

I wanted certain teachers to be able to see hidden courses in hidden categories. I tried two methods using roles. The two methods should have yielded equivalent results, but only one worked.

Method 1: modify the legacy role Teacher (this works)

login as admin
Site administration -> Users -> Permissions -> Define roles
edit the Teacher role
allow "See hidden categories"
allow "View hidden courses"
any Teacher who now logs in can see hidden categories and courses

Method 2: create a new role that inherits from Teacher (this does not work)

login as admin
create a new role CanSee inheriting from legacy role Teacher (editing)
allow CanSee to see hidden categories
allow CanSee to see hidden courses
in site context, assign user X to role CanSee
login as user X – cannot see hidden categories and courses

Issue Links

Activity

Hide
Yu Zhang added a comment -

Hi John,

Just tested this, it is working for me, if your CanSee role is assigned at system context (not the site course context), then the users should be able to see hidden categories. Technically there is no way to inherit from a role, Moodle only allows you to duplicate it so there is no difference between creating a new one, and duplicating one if all the capability definitions are the same.

Show
Yu Zhang added a comment - Hi John, Just tested this, it is working for me, if your CanSee role is assigned at system context (not the site course context), then the users should be able to see hidden categories. Technically there is no way to inherit from a role, Moodle only allows you to duplicate it so there is no difference between creating a new one, and duplicating one if all the capability definitions are the same.
Hide
Helen Foster added a comment -

Hi John,

Please note that when adding a new role, selecting a legacy role type such as Teacher (editing) is NOT the same as duplicating the pre-defined Teacher role. Yes, it's rather confusing at the moment Please see bug MDL-7633

Show
Helen Foster added a comment - Hi John, Please note that when adding a new role, selecting a legacy role type such as Teacher (editing) is NOT the same as duplicating the pre-defined Teacher role. Yes, it's rather confusing at the moment Please see bug MDL-7633
Hide
Petr Škoda (skodak) added a comment -

sure, not the same - in 1.8 you can select the role and then after saving it click on reset button

Show
Petr Škoda (skodak) added a comment - sure, not the same - in 1.8 you can select the role and then after saving it click on reset button
Hide
John Isner added a comment -

I thought the menu of roles (including the legacy roles) were provided as a convenience when defining a new role. You select a role from the menu and all the ticks for that role are populated for you and you only need change a few ticks to "customize" the role, saving it as a new role which (usually differs only slightly from the base role). By the way, I realize this is not inheritance because there is no permanent relationship between the prototype role and the role being defined. But MDL-7633 seems to imply that I need to re-tick all the permissions in the role being newly defined. Can it be? If so, what is the purpose of the menu roles? Roles have seemed very logical to me until now.

Show
John Isner added a comment - I thought the menu of roles (including the legacy roles) were provided as a convenience when defining a new role. You select a role from the menu and all the ticks for that role are populated for you and you only need change a few ticks to "customize" the role, saving it as a new role which (usually differs only slightly from the base role). By the way, I realize this is not inheritance because there is no permanent relationship between the prototype role and the role being defined. But MDL-7633 seems to imply that I need to re-tick all the permissions in the role being newly defined. Can it be? If so, what is the purpose of the menu roles? Roles have seemed very logical to me until now.
Hide
Yu Zhang added a comment -

Hi John, If you are duplicating a role, you do not need to re-tick all the check boxes as they are already ticked for you. You just need to make the changes you want and save them.

Show
Yu Zhang added a comment - Hi John, If you are duplicating a role, you do not need to re-tick all the check boxes as they are already ticked for you. You just need to make the changes you want and save them.
Hide
John Isner added a comment -

That's what I thought, thank you. Roles once again seem logical. I guess Helen's point is that there is no lasting relationship between a newly defined role and the role (if any) used as the prototype for that role. For example, if I define a new role X based on Teacher (editing), and I later modify Teacher (editing), it will not affect role X.

Show
John Isner added a comment - That's what I thought, thank you. Roles once again seem logical. I guess Helen's point is that there is no lasting relationship between a newly defined role and the role (if any) used as the prototype for that role. For example, if I define a new role X based on Teacher (editing), and I later modify Teacher (editing), it will not affect role X.
Hide
Yu Zhang added a comment -

Hi, closing this now, cheers.

Show
Yu Zhang added a comment - Hi, closing this now, cheers.

People

Vote (0)
Watch (1)

Dates

  • Created:
    Updated:
    Resolved: