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

New WS mod_forum_get_forum_access_information

    XMLWordPrintable

Details

    • Improvement
    • Status: Closed
    • Minor
    • Resolution: Fixed
    • 3.6.2, 3.7
    • 3.7
    • Forum
    • MOODLE_36_STABLE, MOODLE_37_STABLE
    • MOODLE_37_STABLE
    • MDL-64655-master
    • Hide
      1. As admin, enable "Mobile services": Site administration ► Mobile app ► Mobile settings
      2. Create a new forum activity in a new course
      3. Enrol two users in the course, one as student and the other one as editing teacher.
      4. Create a Token in the mobile app service for the two users
        • Click on Site administration ► Plugins ► Web services ► Manage tokens
      5. Open the console an execute this new curl request, replacing wstoken with the student token, the site url with yours. The forumid is the forum instance id (the id of the forum in the mod_forum table in the database)

        curl 'http://localhost/m/stable_master/webservice/rest/server.php?moodlewsrestformat=json' --data 'wsfunction=mod_forum_get_forum_access_information&wstoken=3af67232a7596ceb658df4db329e5ad6&forumid=2' | python -m "json.tool"

      6. Now check in the curl response that the following returned fields are set to true: canallowforcesubscribe, cancreateattachment, candeleteownpost, canexportownpost, canreplypost,canstartdiscussion, canviewdiscussion and canviewrating
      7. Execute again the same curl request but this time using the teacher token.
      8. Check that in the curl response all the returned fields are set to true
      Show
      As admin, enable "Mobile services": Site administration ► Mobile app ► Mobile settings Create a new forum activity in a new course Enrol two users in the course, one as student and the other one as editing teacher. Create a Token in the mobile app service for the two users Click on Site administration ► Plugins ► Web services ► Manage tokens Open the console an execute this new curl request, replacing wstoken with the student token, the site url with yours. The forumid is the forum instance id (the id of the forum in the mod_forum table in the database) curl 'http://localhost/m/stable_master/webservice/rest/server.php?moodlewsrestformat=json' --data 'wsfunction=mod_forum_get_forum_access_information&wstoken=3af67232a7596ceb658df4db329e5ad6&forumid=2' | python -m "json.tool" Now check in the curl response that the following returned fields are set to true: canallowforcesubscribe, cancreateattachment, candeleteownpost, canexportownpost, canreplypost,canstartdiscussion, canviewdiscussion and canviewrating Execute again the same curl request but this time using the teacher token. Check that in the curl response all the returned fields are set to true

    Description

      In Moodle web, when the forum is using groups and the user cannot create a discussion because of it, a warning is displayed. We should display the same warning in the app (so this is why we need this new WS).

      Attachments

        Issue Links

          Activity

            People

              jleyva Juan Leyva
              jleyva Juan Leyva
              Mark Nelson Mark Nelson
              Eloy Lafuente (stronk7) Eloy Lafuente (stronk7)
              Janelle Barcega Janelle Barcega
              Adrian Greeve, Ilya Tregubov, Kevin Percy, Mathew May, Mihail Geshoski, Shamim Rezaie
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:
                20/May/19

                Time Tracking

                  Estimated:
                  Original Estimate - Not Specified
                  Not Specified
                  Remaining:
                  Remaining Estimate - 0 minutes
                  0m
                  Logged:
                  Time Spent - 25 minutes
                  25m