Fórum

Guest Comments on Web Content

thumbnail
Josh Asbury, modificado 14 Anos atrás.

Guest Comments on Web Content

Expert Postagens: 498 Data de Entrada: 08/09/06 Postagens Recentes
I have received a request to allow guests to comment on a piece of web content. I add the web content display and change the configuration to "Enable Comments." So far so good. The "Add Comment" link appears..for all users (authenticated and Guest, alike). This is strange, but I forge ahead.

As a Guest, I click the "Add Comment" button, and I see the text box to add a comment. So, I add a comment and receive the "You do not have the required permissions" error. OK, that's a little wonky since if the Guest user doesn't have permissions to add comments, they shouldn't see the option to do so (an LEP is forthcoming).

As the admin, I go into the Control Panel -> Web Content and find the content for which I want to enable this capability. I edit the permissions for Guests and set the "Add Discussion" permission to "What They Can Do". Makes sense, right? As a Guest, I try to add a comment again, and I get the same message.

Hmmm....maybe I need to edit the permissions for the Guest Role? So I click "Define Permissions" for the Guest role and go to the Web Content portlet. I choose "Add Discussion" (1st time for Community and 2nd time for Portal), and I get the same behavior.

So, after having described this, I wonder -- am I missing a step? I think that this is a bug and will submit an LPS, but I am also wondering if I am just being silly here. Any thoughts?

Thanks!
thumbnail
Amos Fong, modificado 14 Anos atrás.

RE: Guest Comments on Web Content

Liferay Legend Postagens: 2047 Data de Entrada: 07/10/08 Postagens Recentes
IN mbmessageserviceimpl.addDiscussionMessage it does a call:

User user = getUser(); //This method is in principalbean.java

I'm pretty sure this will throw an principal exception if the user is a guest user. The comment system wasn't built to allow guest comments even though the permission system allows it.

However the message board system does. If you look in mbmessageserviceimpl.addMessage, you can see how guest(anonymous) users are allowed to post.

It calls getGuestorUserId(), instead of getUser(). And it does some logic to check if it's a guest user or not in mbMessagelocalserviceimpl.java
thumbnail
Josh Asbury, modificado 14 Anos atrás.

RE: Guest Comments on Web Content

Expert Postagens: 498 Data de Entrada: 08/09/06 Postagens Recentes
Thanks, Amos -- that makes sense. I'll update the LPS to indicate that the Add Comment link shouldn't appear for Guests if they don't *really* have permissions to do so.
Kurt Krieg, modificado 10 Anos atrás.

RE: Guest Comments on Web Content

New Member Postagens: 2 Data de Entrada: 15/05/13 Postagens Recentes
Hello Joshua,

I am using Liferay 6.1. and would like to Guest users to comment as well. Is it possible that 6.1. has the same problem? It seems, that guest comments are only partially possible when I allow foreigners to create accounts.

Thanks,
Kurt