Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 1.8
    • Fix Version/s: 1.8.1
    • Component/s: Roles / Access
    • Labels:
      None
    • Environment:
    • Database:
      MySQL
    • Affected Branches:
      MOODLE_18_STABLE
    • Fixed Branches:
      MOODLE_18_STABLE

      Description

      "Login as" doesn't work.

      I'm logged in as admin, then I go into a course, in participants I choose a student, click "login as", get the following message:
      "You are logged in as ...."
      When I click on "continue" I get following message:
      "Sorry, but you can not enter this course as ..."

        Gliffy Diagrams

          Issue Links

            Activity

            Hide
            skodak Petr Skoda added a comment -

            That is strange, you need to have course:view permission for both accounts. Participant has it, but admin should have it too in all courses.

            Moodle complains that you (the one trying to login as) do not have course:view permission. Are you using the default 'admin' account or any custom role definition?

            I can not replicate it on my test site

            Show
            skodak Petr Skoda added a comment - That is strange, you need to have course:view permission for both accounts. Participant has it, but admin should have it too in all courses. Moodle complains that you (the one trying to login as) do not have course:view permission. Are you using the default 'admin' account or any custom role definition? I can not replicate it on my test site
            Hide
            baltaner Bertold Altaner added a comment -

            Hi,
            thanks for your help.
            I reset all my roles when upgrading to 1.8. the admin-role: course:view is set to "inherit"
            When I edit the admin-role like your advice (course:view "allow") everything is working - I can do the "login as".
            It seems that the default-roles aren't set right, or?

            Show
            baltaner Bertold Altaner added a comment - Hi, thanks for your help. I reset all my roles when upgrading to 1.8. the admin-role: course:view is set to "inherit" When I edit the admin-role like your advice (course:view "allow") everything is working - I can do the "login as". It seems that the default-roles aren't set right, or?
            Hide
            skodak Petr Skoda added a comment -

            The reset "resets" to legacy defaults. Did your admin account have legacy:admin?

            Show
            skodak Petr Skoda added a comment - The reset "resets" to legacy defaults. Did your admin account have legacy:admin?
            Hide
            baltaner Bertold Altaner added a comment -

            Where do I find legacy:admin?

            I only see in the roles-header:
            Name: Administrator/in
            Short name: admin
            Description: Administrator/innen haben normalerweise alle Rechte auf der Website und in allen Kursen.
            Legacy role type: LEGACY ROLE: Administrator

            Show
            baltaner Bertold Altaner added a comment - Where do I find legacy:admin? I only see in the roles-header: Name: Administrator/in Short name: admin Description: Administrator/innen haben normalerweise alle Rechte auf der Website und in allen Kursen. Legacy role type: LEGACY ROLE: Administrator
            Hide
            skodak Petr Skoda added a comment -

            Legacy role type: LEGACY ROLE: Administrator replaced old moodle/legacy:admin in the definition. It means that your admin has a legacy admin role.
            Does it have "Allow" for majority of permissions?
            Or is it Inherit/Not set?
            Which colum has darker background (means legacy defaults)?

            Show
            skodak Petr Skoda added a comment - Legacy role type: LEGACY ROLE: Administrator replaced old moodle/legacy:admin in the definition. It means that your admin has a legacy admin role. Does it have "Allow" for majority of permissions? Or is it Inherit/Not set? Which colum has darker background (means legacy defaults)?
            Hide
            baltaner Bertold Altaner added a comment -

            In "view role details" admin-roles: ALL - except the following listed - are set to "allow":
            moodle/course:view "inherit"
            mod/assignment:submit "inherit"
            mod/feedback:complete "prevent"
            mod/forum:throttlingapplies "inherit"
            mod/forum:initialsubscriptions "inherit"
            mod/lams:participate "inherit"
            mod/quiz:attempt "inherit"
            mod/quiz:ignoretimelimits "inherit"
            mod/scorm:skipview "inherit"
            mod/workshop:participate "inherit"

            Was that what you want to know?

            Show
            baltaner Bertold Altaner added a comment - In "view role details" admin-roles: ALL - except the following listed - are set to "allow": moodle/course:view "inherit" mod/assignment:submit "inherit" mod/feedback:complete "prevent" mod/forum:throttlingapplies "inherit" mod/forum:initialsubscriptions "inherit" mod/lams:participate "inherit" mod/quiz:attempt "inherit" mod/quiz:ignoretimelimits "inherit" mod/scorm:skipview "inherit" mod/workshop:participate "inherit" Was that what you want to know?
            Hide
            skodak Petr Skoda added a comment -

            yes, thanks!

            hmm, I wonder why you needed to allow course:view - the moodle/site:doanything should allow admin to go into any course - maybe there is a bug somewhere in has_capability()

            thanks for the cooperation, I think I understand the problem now

            Show
            skodak Petr Skoda added a comment - yes, thanks! hmm, I wonder why you needed to allow course:view - the moodle/site:doanything should allow admin to go into any course - maybe there is a bug somewhere in has_capability() thanks for the cooperation, I think I understand the problem now
            Hide
            skodak Petr Skoda added a comment -

            found the bug, testing patch

            Show
            skodak Petr Skoda added a comment - found the bug, testing patch
            Hide
            skodak Petr Skoda added a comment -

            should be fixed in cvs,
            thanks for the report!

            Show
            skodak Petr Skoda added a comment - should be fixed in cvs, thanks for the report!
            Hide
            cahaland Denis Cahalane added a comment -

            This bug affects 1.7 as well (I'm currently testing 1.7.2 for our site). Any chance of a fix?

            Show
            cahaland Denis Cahalane added a comment - This bug affects 1.7 as well (I'm currently testing 1.7.2 for our site). Any chance of a fix?
            Hide
            michaelp Michael Penney added a comment -

            "This bug affects 1.7 as well (I'm currently testing 1.7.2 for our site). Any chance of a fix?"

            Setting View courses to Allow for the admin should fix this in 1.7 (it does in mine.

            Show
            michaelp Michael Penney added a comment - "This bug affects 1.7 as well (I'm currently testing 1.7.2 for our site). Any chance of a fix?" Setting View courses to Allow for the admin should fix this in 1.7 (it does in mine .

              People

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

                Dates

                • Created:
                  Updated:
                  Resolved:
                  Fix Release Date:
                  11/Jun/07