[MGNLCMNT-94] make sure commenting works with anonymous user Created: 04/Feb/14 Updated: 03/Mar/14 Resolved: 19/Feb/14 |
|
| Status: | Closed |
| Project: | Commenting (closed) |
| Component/s: | security, VersionHandler |
| Affects Version/s: | None |
| Fix Version/s: | 2.2 |
| Type: | Task | Priority: | Neutral |
| 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: |
|
||||||||||||||||||||||||||||
| Template: |
|
||||||||||||||||||||||||||||
| Acceptance criteria: |
Empty
|
||||||||||||||||||||||||||||
| Task DoR: |
Empty
|
||||||||||||||||||||||||||||
| Date of First Response: | |||||||||||||||||||||||||||||
| Description |
|
Commenting requires the role "forum-pagecomments-user". Add this to user anonymous to ensure he is able to comment. |
| Comments |
| Comment by Christoph Meier [ 04/Feb/14 ] |
|
Added role forum-pagecomments-user to anonymous-user, but: |
| Comment by Christoph Meier [ 07/Feb/14 ] |
|
Probably a caching problem; ReferencedPageFlushPolicy or super-class not working properly. |
| Comment by Christoph Meier [ 13/Feb/14 ] |
|
Defintely a caching problem; ReferencedPageFlushPolicy or super-class not working properly. If somebody wants to tackle this one: startt debuging in ReferencedPageFlushPolicy#handleSingleEvent, I also tried to flush the page from PageComments (the model of the template which renders the commenting-messages), but was not able to do so. |
| Comment by Christoph Meier [ 17/Feb/14 ] |
|
Since |
| Comment by Christoph Meier [ 18/Feb/14 ] |
|
I'll set this one to resolved to integrate the other work which was done here (adding the appr. role to anonymous). |
| Comment by Espen Jervidalo [ 18/Feb/14 ] |
|
remove all the commented lines in CommentingModuleVersionHandler |
| Comment by Roman Kovařík [ 19/Feb/14 ] |
try {
usersSession = installContext.getJCRSession(RepositoryConstants.USERS);
userRolesSession = installContext.getJCRSession(RepositoryConstants.USER_ROLES);
anonymousUserNode = usersSession.getRootNode().getNode("system/anonymous");
forumPpagecommentsUser_role_node = userRolesSession.getRootNode().getNode("forum-pagecomments-user");
} catch (Exception ex) {
installContext.warn("Exception while trying to add role forum-pagecomments-user to anonymous; "+ex.getLocalizedMessage());
}
return anonymousUserNode!=null && forumPpagecommentsUser_role_node!=null;
That's not the right way how to check if anonymous user / forum-pagecomments-user role exists, you should use info.magnolia.cms.security.RoleManager.getRole(String)/ UserManager.getAnonymousUser() to get such information That code should be replaced, but couple of hints for next time:
|