[MGNLCMNT-107] pagecommenting per locale and/or per site is not working Created: 29/Apr/14  Updated: 15/May/14  Resolved: 14/May/14

Status: Closed
Project: Commenting (closed)
Component/s: security
Affects Version/s: 2.2
Fix Version/s: 2.2.1

Type: Bug Priority: Critical
Reporter: Christoph Meier Assignee: Christoph Meier
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
dependency
depends upon MGNLFORUM-259 Creating thread- and forum-node shoul... Closed
Template:
Acceptance criteria:
Empty

 Description   

Pagecommenting per locale and/or per site is not working; it has several reasons.

  • 1st reason: see MGNLCMNT-20; comment from Eric Hechinger, added a comment - 14/Mar/12 9:16 AM => /modules/commenting/templates/components/comments/parameters/@forumName should be removed
  • 2nd reason: Forum-node (and thread-node, too) here are created on the fly when the page of a certain locale and site are requested for the 1st time; but anonymous-user currently cannot create a forum or a thread (since "simple security model" has been introduced with forum-3.3) ... {DefaultForumManager#createForum}

    has 2 problems:

    • checking isModerator(hm, repoRoot) will fail (easy to fix ... but probably a sec.-problem)
    • repoRoot.createContent(cleanName, FORUM_NODETYPE) => will always fail ... anonymous-user requires more rights


 Comments   
Comment by Christoph Meier [ 07/May/14 ]

After removing the property /modules/commenting/templates/components/comments/parameters/@forumName from the config.
Multi-locale page-commenting works, if the user has appropriate permissions.

But: Multisite and the combination of multisite and multi-locale enabled fails.
Reason: Everytime when trying to submit a comment, siteName is evaluated, but this fails:
PageComments#determineForumToUse line 206
calls
Defaults#determineSiteName
which fails because
if (model.getRoot() instanceof STKPageModel) ... is false when the model is of the type PageComments.

so ... either PageComments must be adapted in way that it is of type STKPageModel or the implementation of Defaults#determineSiteName must be adapted.

Comment by Christoph Meier [ 07/May/14 ]

If the above issue is fixed, the current user requires appropriate permissions:

  1. there must be a role forum-<expected-forum-name>-user , e.g. forum-pagecomments_de-user or pagecomments-demo-project_en ,etc.
  2. that role from (1) must have read/write permissions on the forum-workspace for the path /<expected-forum-name> (and also should have read-permission on the users-workspace on the path /forum-<expected-forum-name>-user )
  3. that role must be granted to anonymous-user (or to those users which should be allowed to read/write comments in the desired multisite- or multi-locale-context)

AND: To enable multi-site or multi-locale -commenting, the user must remove the property /modules/commenting/templates/components/comments/parameters/forumName, at least its value must be empty.
If the property is set, its value is used as the forum-name. For sure there should be a role with read/write permissions and the role must be granted to anonymous-user (as explained above).
The default value for this is property is still pagecomments - what is compeltly ok.

Comment by Christoph Meier [ 14/May/14 ]

Committed onto branch "MGNLCMNT-107"
(See https://git.magnolia-cms.com/gitweb/?p=modules/commenting.git;a=commit;h=04eae6b20ae92a28b1b06ef5858eb693e2f5a276 )

Generated at Mon Feb 12 00:03:13 CET 2024 using Jira 9.4.2#940002-sha1:46d1a51de284217efdcb32434eab47a99af2938b.