Allowing guests to post in forum?

This forum post has been removed

Number of replies: 14
The content of this forum post has been removed and can no longer be accessed.
In reply to Deleted user

This forum post has been removed

The content of this forum post has been removed and can no longer be accessed.
In reply to Deleted user

Re: Allowing guests to post in forum?

by Peter Sinn -
Same problem here. Anybody knows how to deal with it?
In reply to Peter Sinn

Re: Allowing guests to post in forum?

by Helen Foster -
Picture of Core developers Picture of Documentation writers Picture of Moodle HQ Picture of Particularly helpful Moodlers Picture of Plugin developers Picture of Testers Picture of Translators
Well, there are certain things, such as posting in a forum, that guests are never allowed to do, despite the permissions interface suggesting otherwise.

The guest role has some special functionality, for example when a guest user attempts to post in a forum, they obtain the message "Sorry, guests are not allowed to post. Would you like to log in now with a full user account?" No other role has this functionality.

If you wish guests to be able to post in a forum, you can create a similar role, say "visitor" with very few permissions allowed, then create an account and assign it the role of visitor. Guests can then share this visitor account.
Average of ratings: Useful (2)
In reply to Helen Foster

Re: Allowing guests to post in forum?

by John Isner -
Helen,
I would say that that this "special behavior" occurs because Forum has not been fully converted to the new roles and capabilities system. The "Sorry" notice is based on a test for the legacy capability moodle/legacy:guest. The code should be using the new forum capabilities. Entering MDL-12917.
In reply to John Isner

Re: Allowing guests to post in forum?

by Ray H -
Here's a way around this issue:
  1. go to "admin/roles/manage.php"
    edit the Guest's legacy role to be "None"

  2. then in the course of your choosing, under the "Administration" menu, click on "Assign Roles" and then "Override Roles".

    here you'll want to change "Start new discussions" and "Reply to posts" to "Allow"
This works for me!
In reply to Ray H

Re: Allowing guests to post in forum?

by Steve Hyndman -

I would be very careful about editing legacy roles (or whatever they're called) at the site/system level. You may indeed end up enabling the specific feature you want, but you may also change other behaviors that you don't know about.

That's one major problem with this roles system...when you start fiddling with them, you can never be completely sure you haven't added a capability that you had no intention of adding.

Steve

In reply to Steve Hyndman

Re: Allowing guests to post in forum?

by Ray H -
You're right...

I just discovered that the solution I gave enabled guest access across all courses!

Need to find another way around this problem.
In reply to Ray H

Re: Allowing guests to post in forum?

by John Isner -
Here's the test in course/enrol.php that decides whether to allow guests:

    if(
      has_capability('moodle/course:view',$context) and
      !has_capability('moodle/legacy:guest',$context)
    ){
        ...
        // admit user to course
    }

So if you're a Guest with a capital G, but you don't have the guest with a small g in your pocket, you get to enter the course.

As Steve says, by removing the legacy role type from any of the predefined roles, "you may also change other behaviors that you don't know about."  I think this is particularly true of Guest.

The question that I've been unable to answer is whether the above behavior is "legacy behavior" (i.e., behavior we can expect to go away as legacy roles are phased out), or whether it is a permanent feature of Moodle.  And if it is a permanent feature, can someone please explain it?
In reply to Ray H

Re: Allowing guests to post in forum?

by Rafael Fernandez -
I just want to know how I enable the reply button to guests (even though they need ro register..) 


I want the button to appear so that I can get more users and potential students to my courses. 


Any help will be very appreciated!

In reply to Rafael Fernandez

Re: Allowing guests to post in forum?

by Colin Fraser -
Picture of Documentation writers Picture of Testers

Rafael, this question is asked fairly frequently, actually and the answer seems to vary on occasions. Yes, you can allow guests to log in as "Guests" and yes, you can allow them to access a forum and allow them to post. But, the issue is always the same, how can you distinguish which post is made by which Guest. You can't, simple as that. If you accept that in your Moodle then yes, it is doable for sure. 

Makes sure that you have allowed Guest logins to your Moodle. Create your Forum, on the Front Page is probably where you want it anyway, and set out the rules around how to make responses. For example:

"As a Guest, you can reply in this Forum and all comments are welcome. Please respect other people's views do not stoop to abusing someone because you disagree. All clever, comical, controversial comments are welcome, but outright abuse will be deleted as soon as detected. It would be considered good manners, though, for you to sign each post you make with your name."     

I don't know what you want here but you can work it out. As long as you make it clear what you do want, it should be ok. 

As for the Forum settings, these are your normal settings except go to Administration > Permissions  and select "Guest" from the drop-down, scroll down to "Reply to Posts" and select "Allow". This is the only permission you need to change, you don't want Guests doing anything else, and that should do it. 

In reply to Colin Fraser

Re: Allowing guests to post in forum?

by Colin Fraser -
Picture of Documentation writers Picture of Testers

The addendum here is that it seems this varies from version to version, as well. But what I suggest above should work. 

This is a thread from 2009 so we are also looking at a hugely different version of Moodle. 

In reply to Helen Foster

Re: Allowing guests to post in forum?

by Anil Sharma -
Is there a way of preventing guests from seeing the button "Add a new discussion topic" in forums ? Since the nature of the role prevents them from not being able to write, the button itself should not be visible. Further, when we prevent the role from replying to posts, the "Reply" option should also not be visible.


In reply to Anil Sharma

Re: Allowing guests to post in forum?

by ces moce -
Hello,

I've checked the different advice... but is there any ''good'' solution finally?

i definitely need to alow guest to post in a specific course forum....

i'm using moodle 1.93
In reply to Helen Foster

Re: Allowing guests to post in forum?

by Wim Van Borm -

Hello Helen,

When you're using this new VISITOR role is it possible like the guest account to skip the login page by a URL?

This way I would be able to grant the proper right to the Visitor role but still allow the Visitor to access directly the intended course.

thanks
Wim