Uploaded image for project: 'Moodle'
  1. Moodle
  2. MDL-40471

Badges 'manage' node in navigation needs to consider more capabilities

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 2.5
    • Fix Version/s: 2.5.3
    • Component/s: Badges
    • Labels:
    • Testing Instructions:
      Hide

      You need a course and course badges enabled on web site.

      Create a user and enroll this user to the course as a student (or any other role, but easier to test with students as they have very limited capabilities).

      1. Login as a student. Go to the course. Make sure that you can't see "Badges" in course administration.

      2. As an admin allow student role to create a badge in this course (badges:createbadge). As a student, go to the course. Now, you should be able to see "Badges > Manage Badges" and "Badges > Add a new Badge" in course administration.

      3. As a student, try creating a badge. When done, you should be redirected to Badge overview page. No other tabs (except "Overview") should be shown.

      4. As an admin, now allow student role to configure criteria of badges in this course (badges:configurecriteria capability). As a student, create another badge. When done, you should be redirected to Badge criteria page. You should be able to see "Overview" and "Criteria" tabs.

      5. As an admin, remove "create badge" and "configure criteria" capabilities of a student role in this course. Students should no longer be able to perform any of the previous actions. Navigation elements should be removed (I am not quite sure if users should log out and log in for this to happen as navigation tree might be cached per user session).

      6. As an admin, enable "award badge" capability for a student role in this course. As and admin, create a course badge (or edit existing one created earlier). Add "Manual award" criteria and select "Student" among roles in criteria settings. Save criteria and enable badge. As a student, go to the manage bagdes page and try to award a badge. You should be able to award a badge to anyone in this course with capability "earn badge" (students by default), but no other actions.

      Show
      You need a course and course badges enabled on web site. Create a user and enroll this user to the course as a student (or any other role, but easier to test with students as they have very limited capabilities). 1. Login as a student. Go to the course. Make sure that you can't see "Badges" in course administration. 2. As an admin allow student role to create a badge in this course (badges:createbadge). As a student, go to the course. Now, you should be able to see "Badges > Manage Badges" and "Badges > Add a new Badge" in course administration. 3. As a student, try creating a badge. When done, you should be redirected to Badge overview page. No other tabs (except "Overview") should be shown. 4. As an admin, now allow student role to configure criteria of badges in this course (badges:configurecriteria capability). As a student, create another badge. When done, you should be redirected to Badge criteria page. You should be able to see "Overview" and "Criteria" tabs. 5. As an admin, remove "create badge" and "configure criteria" capabilities of a student role in this course. Students should no longer be able to perform any of the previous actions. Navigation elements should be removed (I am not quite sure if users should log out and log in for this to happen as navigation tree might be cached per user session). 6. As an admin, enable "award badge" capability for a student role in this course. As and admin, create a course badge (or edit existing one created earlier). Add "Manual award" criteria and select "Student" among roles in criteria settings. Save criteria and enable badge. As a student, go to the manage bagdes page and try to award a badge. You should be able to award a badge to anyone in this course with capability "earn badge" (students by default), but no other actions.
    • Affected Branches:
      MOODLE_25_STABLE
    • Fixed Branches:
      MOODLE_25_STABLE
    • Pull from Repository:
    • Pull Master Branch:
      MDL-40471_master

      Description

      Upon testing MDL-39986 I noticed there are a number of capabilities which seem like they need to add the 'manage badges' menu to be able to get to the page to manage them if you only have that single capability. It probably means converting the navigation item capability check to a has_any_capability() call

      We also should check through a role with each of these capabilities and ensure that you can do the action with only that:

      moodle/badges:awardbadge
      moodle/badges:configurecriteria
      moodle/badges:configuredetails
      moodle/badges:configuremessages
      moodle/badges:createbadge
      moodle/badges:deletebadge
      moodle/badges:earnbadge
      moodle/badges:viewawarded
      moodle/badges:viewbadges

        Gliffy Diagrams

          Attachments

            Issue Links

              Activity

                People

                • Votes:
                  0 Vote for this issue
                  Watchers:
                  5 Start watching this issue

                  Dates

                  • Created:
                    Updated:
                    Resolved:
                    Fix Release Date:
                    11/Nov/13