Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Hi there,
it will be great if the forum access provide a combo that allows to answer posts in a forum, but not creating them.
This will be great for an announcement forum where only management could post news but all the community could comment on them.
Thanks in advance.
Comment | File | Size | Author |
---|---|---|---|
#85 | forum_access_545916_85.patch | 12.41 KB | nonsie |
#63 | forum_access_545916_63.patch | 8.72 KB | nonsie |
#56 | Capture-DNA.jpg | 640.78 KB | mfby2k |
#54 | Untitled.png | 10.58 KB | mfby2k |
#40 | forum_access-545916-d7.patch | 7.45 KB | ohnobinki |
Comments
Comment #1
salvisActually, this was the behavior we had in D5, and many of us saw the inability to control comments as a missing feature. We added it in #310254: Control posting rights for comments/replies in D5 for D6 (and it proves difficult to backport it to D5), but I see now that the old behavior was useful, too.
I'm not so eager to add more columns — maybe just a global switch?
Comment #2
highvoltage CreditAttribution: highvoltage commentedI need this also for a site updates/polls/news forum section that only moderators/admins can post in, but users need to be able to comment on the posts.
A global switch would be ok in my case, I think. I don't really have any need to restrict both commenting and posting nodes. Couldn't say for anyone else. <_<
Comment #3
Vchris CreditAttribution: Vchris commentedI want that future too, but in specific forums, not whole the forum :(
(etc at the forum "announcements, but not at the forum "ask for help" )
Comment #4
salvisI have implemented 'Drupal 5 legacy mode' to allow a smooth upgrade from Drupal 5; see #552636: Forum post vs. reply not functioning correctly.
I'm still undecided whether to offer this for individual forums (i.e. a checkbox per forum) or even for specific roles (i.e. splitting the Post column in two).
If we split Post, will we have to split Edit and Delete, too?
Comment #5
highvoltage CreditAttribution: highvoltage commentedAnyone posting actual nodes there would be a moderator already, and already have edit or delete privileges, correct? Only the ability to add comments are being changed I thought. Maybe I don't understand. <_<
Comment #6
salvishighvoltage: I'm confused by what you write. People can be moderators (with all rights), they can have Post rights, Edit rights, and Delete rights. That's all completely independent. In D6 mode, comments are treated like posts, in D5 legacy mode they're unaffected by Forum Access.
Comment #7
highvoltage CreditAttribution: highvoltage commentedThere's no distinction between creating a node and posting a comment in the permissions?
Comment #8
salvisExactly. This is what it says when you open the 'Permissions information' fieldset. Both need Post and their respective Drupal permissions.
Comment #9
apanag CreditAttribution: apanag commentedSo is there any solution to overcome this problem, without hacking around?
Comment #10
salvisSee #4 above.
Comment #11
apanag CreditAttribution: apanag commentedThanks salvis.
I think we should split the create a new topic and create a new comment, because they are two different things on drupal. Each one with its own settings. So we have to think them as separate. And of course i think it must be per role for all the forums.
I dont think to split edit or delete, because if someone has the permission to moderate content, he/she should moderate both topics and posts. Because a topic with its comments it is one logical entity. If i have the permission to edit/delete a node, i want to have the permission to edit/delete its comments too.
apanag
Comment #12
apanag CreditAttribution: apanag commentedHello,
do we have any updates about spliting the permissions?
Thank you,
apanag
Comment #13
salvisNo, do you want to work on it?
Comment #14
apanag CreditAttribution: apanag commentedI am going to try a few things, but i ll have a deadline for a project at 2/10. So until then. i am going to code as much as possible.
Firstly i am going to read your code and try to figure out what happens in it.
Comment #15
fersman4 CreditAttribution: fersman4 commentedI personally would like to see this implemented to be configurable both on a per-role basis and on a per forum basis. The 'Announcement' scenario is exactly what I'm looking for (#3 above). I don't see it being necessary to split Edit and Delete, for my purposes at least, but I suppose to could be implemented for completeness.
Comment #16
fersman4 CreditAttribution: fersman4 commentedI'm thinking things over and I think I may go with the Node Comment module so that I can have comments with CCK fields and permissions. This will make my need for this feature moot, since I would need to use the Taxonomy Access Control module to do what I need to do.
Comment #17
salvisAdding Node Comment support to FA is another item on my list...
Comment #18
Stonerocker CreditAttribution: Stonerocker commentedAny updates as to when this module might be fixed?
Comment #19
salvisI'm not aware of anything that needs to be fixed at this point.
Comment #20
Stonerocker CreditAttribution: Stonerocker commentedWhatever needs to be fixed so that users can't post new topics but can still comment. Any news on that being fixed, whether you were gonna do that drupal 5 legacy thing and have the module ignore comments altogether, or split the post column into two columns, one post, and the other comment?
Comment #21
salvisYou're wasting my time. Please read the thread.
Comment #22
Stonerocker CreditAttribution: Stonerocker commentedI did, and it was already obvious you weren't planning on doing anything about this issue. I was actually asking Apanag since he said he might work on it. He doesn't seem to be answering though. I do think the module would be much better if the post permissions were split into two columns though, although judging from your response it doesn't look like that will be happening anytime soon. I guess I'll just try the node comment module and the access taxonomy module combo that fersman4 suggested.
Comment #23
salvisThe D5 legacy mode is implemented as per #4.
Beyond that we're talking about feature requests, not things that need to be "fixed".
Comment #25
aharown07 CreditAttribution: aharown07 commentedAdd me to list of those who would much appreciate per-forum ability to allow comment posting w/o allowing new topic/node posting.
I'd gladly submit a patch if I knew how to write one. Still dependent on smarter people for that.
Comment #26
aw04obee CreditAttribution: aw04obee commentedHad this issue myself but I could personally fix this with D5 legacy mode as I did not need very granular control. Took me a couple of minutes to find where the setting was though, so to be sure, it is located at admin/content/forum/settings
Comment #27
rv0 CreditAttribution: rv0 commented+1 to have this as an option in the form of a permission.
and yes, if "post" permission would be split up, it should also have to be split up for edit and delete obviously.
Maybe it should look a little bit more like the general permissions page in core?
What are the implications of D5 legacy mode? I don't really understand, and searched but could not find.
I turned it on and it works indeed.
And how will all that translate to D7?
thanks
Comment #28
salvisI'm not sure about splitting up edit and delete. The sweet spot is somewhere between global and finest-grained. I doubt its at one of the extreme ends.
What is it in the explanation of D5 legacy mode on admin/content/forum/settings that you don't understand?
If we get split Post in D7, then D5 legacy mode will go away.
Comment #29
rv0 CreditAttribution: rv0 commentedI dunno.. it's a "feature" you will see in any professional forum package so I don't see why it would be redundant in a forum access module.
But I understand there might be D6 architectural motives for your current opinion on this matter.
Oh I do understand, I was just wondering about further implications for the rest of the site and other contrib modules.
And so there are implications now I think about it..
I have a forum where all "closed" topics get moved to. Normal users don't have permission to post there so they can't add comments to the "closed" topics by D6 design.
If I enable D5 legacy mode, I won't be able to stop people from adding further comments to those closed threads.
I see "locking topics" will be a feature for D7 so that would solve it.
Thanks for your time.
Comment #30
aharown07 CreditAttribution: aharown07 commented+1 for splitting edit and delete. This is indeed a pretty industry standard forum feature.
But posting w/o starting new threads... even more basic.
Comment #32
salvisYou're asking to double the number of checkboxes. It seems that we have to double them again to handle unpublished content...
Comment #33
aharown07 CreditAttribution: aharown07 commentedI don't see why the number of checkboxes would have to be expanded much.
Why not just add a "allow comment only" (or something like that) per role?
Comment #34
salvisComment only what? View? Post? Edit? Delete? See #27...
Where should we draw the line?
Comment #35
aharown07 CreditAttribution: aharown07 commentedI was still thinking in terms of the original post... just permission to add comments to a node without permission to add nodes. So "view" would have to be included, of course, but edit/delete not necessarily. I do see the difficulty in where to draw the line. Maybe it needs to be a separate module.
Comment #36
salvisFocus is shifting to D7: this could go into 7.x-2.x after 7.x-1.0 is released.
A backport to 6.x-2.x would only be realistic if someone completes #762270: WANTED: SimpleTests for Forum Access...
Comment #39
ohnobinki CreditAttribution: ohnobinki commented+
Comment #40
ohnobinki CreditAttribution: ohnobinki commentedThis patch adds a new permission, 'comment', which grants commenting on any topic in a forum.
It is supposed to:
It lacks:
edit: P.S., I'm interested in backporting to drupal6 if/when this patch is beaten into something acceptable ;-).
Comment #41
salvisAh, that's a great start, thank you!
I recognize the value of your Comment permission. OTOH, I'd like to keep FA as slim as possible.
Having separate Post and Comment permissions implies a certain mode of operation of a forum, for example, members of the Board of Directors can comment and start new discussions but normal association members can only comment in existing discussions.
If that's how you want to operate a forum, this is exactly what you need. However, many forums (probably most forums) don't have that two-tiered membership and for those the introduction of a new permission (that they'll have to maintain in sync with Post manually) is a pain.
Could we make the Comment permission optional, i.e. hide the column (and keep using Post for both nodes and comments) until the admin requests a split of the Post permission (per forum)?
You're trying to keep complexity down by introducing only one new permission, but I'm sure that requests for View, Delete, and Update Comments will follow, and we should be prepared for that.
Comment #42
Taxoman CreditAttribution: Taxoman commentedThat sounds reasonable.
Comment #43
mr.j CreditAttribution: mr.j commentedThis feature is definitely needed, and I would argue all the granular permissions for post, edit, and delete.
There are problems with both options at the moment:
- The problem with using Drupal 5 legacy mode is that mods cannot edit or delete other users' comments without having the global administer comments permission. And that permission lets a mod edit/delete comments site-wide, not just the forum they moderate.
- If you don't use D5 mode, then you cannot have a forum where only certain roles are allowed to post topics, but everyone else can comment. I would guess that this is a fairly common requirement (it is on most sites I work on).
I think the UI complexity - which seems to be the main reason being given to resist this - can be overcome by redesigning the permissions UI so that it uses a table just like the main drupal permissions page. This would remove the repeated role names which make the UI look more bulky that it actually is.
Permissions that I would include:
- View Forum (applies to both nodes and comments, I can't think of why you would need to separate these)
- Post Topics
- Edit Topics
- Delete Topics
- Post Comments
- Edit Comments
- Delete Comments
Put them in a table as rows with the roles as columns, just like the Drupal permissions page.
I think it would also be good to provide some clarification that the Edit and Delete options actually apply to all user posts/topics, not the user's own ones (which can be controlled in the main Drupal permissions page with the edit own topics permission).
Comment #44
salvisNo. The number of permissions may grow, but not indefinitely. OTOH, there's no limit to the number of roles, and these should go downwards.
Comment #45
Taxoman CreditAttribution: Taxoman commentedMaybe its time core provides a general pivoting function, but that is another issue. Yet another is the ability to "freeze" the left column as is currently done with the role titles: when scrolling horizontally, the left column should stay on screen when there is more to see beyond the right side of the visible area.
Edit: scratch my last comment, I did not read this thread very carefully before posting.
If the permissions would be named as suggested in #43, and not be many more than that, then obviously they should be column headers, having roles flow downwards, as they may be many more.
Comment #46
mr.j CreditAttribution: mr.j commentedSure, whatever. It would be better either way. I suggested that way as it is consistent with Drupal admin.
Comment #47
Imper1um CreditAttribution: Imper1um commentedIs there any progress on this issue?
Comment #48
salvisNo, this will not start before 7.x-1.0 is released.
You can help to get us there by testing beta and rc versions and posting positive comments under #809404: Forum Access for D7 if everything works or bug reports in new issues otherwise.
Comment #49
Anonymous (not verified) CreditAttribution: Anonymous commentedI am also waiting for this feature to be implemented
Comment #50
mvlabat CreditAttribution: mvlabat commentedHello.
I've installed the .patch above, and trying to apply some rights I receive series of errors:
"DOException: SQLSTATE[23000]: Integrity constraint violation: 1048 Column 'grant_comment' cannot be null: INSERT INTO {forum_access} (tid, rid, grant_view, grant_update, grant_comment, grant_delete, grant_create, priority) VALUES (:db_insert_placeholder_0, :db_insert_placeholder_1, :db_insert_placeholder_2, :db_insert_placeholder_3,
...
[:db_insert_placeholder_86] => 0 [:db_insert_placeholder_87] => 0 ) в функции _forum_access_form_submit() (строка 633 в файле ***/sites/all/modules/forum_access/forum_access.admin.inc)."
... and nothing applies.
Is the patch working? Could anyone help me to solve this problem?..
Comment #51
salvisIf you assign yourself, that means that you're going to work on it and no one else should touch it until you come up with results.
Comment #53
mvlabat CreditAttribution: mvlabat commentedOh, salvis, excuse me... I did it accidentally. Corrected. (Ooops...)
Comment #54
mfby2k CreditAttribution: mfby2k commentedI have this problem that posting comment is allowed but creating a new forum topic is not allowed for any user except administrators.
the DNA shows the Relatedlinks module denies this access as shown in the picture.
Comment #55
salvis@mfby2k: #54 is completely unrelated to this feature request.
Please post this in the Relatedlinks queue. The Relatedlinks maintainer should figure out what is going on in the first place (whether Relatedlinks is behaving as intended), and when that is cleared up, it may need to be moved to the Devel queue for investigation as mentioned in the hint.
To be useful, we'll need a full screenshot of your DNA blocks.
Comment #56
mfby2k CreditAttribution: mfby2k commentedthanks for your reply
I have posted it to relatedlinks issue queue here is the link http://drupal.org/node/1444022 but got no response.
I was searching for it and found this post closely related to my problem so i posted here in hope of getting some help.
I have also discussed it with Advance forum issue queue (Michelle ). She also cant figured it out.
I have attached the full view of DNA block.
Comment #57
salvisI said it was completely unrelated. Since you don't accept my judgement, I won't waste my time with you.
Hijacking threads is unacceptable. Get out of this thread NOW!
Comment #58
mfby2k CreditAttribution: mfby2k commentedOK dont be so angry
it is not closely related to my problem i accept your judgement. This thread request this feature which i want to get rid off. all the registered user can comment on forum post but can not start a new thread.
will you help me...
Comment #59
shane1090 CreditAttribution: shane1090 commentedIs this functionality still in progress? It would be extremely useful to me
Comment #60
salvisThis has not started yet.
Comment #61
thyssimonis CreditAttribution: thyssimonis commented#40: forum_access-545916-d7.patch queued for re-testing.
Comment #63
nonsieThis is a patch against 7.x-1.x-dev based on #40 with one slight change - it adds create comment permission (comment_create fields vs comment field). If in the long run this module needs to support comment edit/delete then at least the field names will make sense.
Make sure to run updates or your users will not be able to post comments in forums!
Comment #64
salvisPlease set the status to activate the testbot.
Comment #66
salvisI'm not sure whether the testbot is able to apply the database update, but I get 40 fails locally even after running update.php.
Comment #67
nonsieHere's an updated patch with the tests updated as well to accommodate this new access permission. The tests were failing because I never updated them.
Comment #69
nonsieComment #70
nonsieWhat is needed to get this committed?
Comment #71
salvisSorry for the delay. Thank you for getting this to pass.
Please preserve the coding style: things that are aligned should remain aligned when a new (longer) item is inserted.
We will need tests for the new functionality, just like we have for the existing one.
We have to get a few people to care enough about this functionality that they'll review your patch. If you're the only one who is interested in this, then it does not make sense to commit it.
Posting a screenshot of the changed interface might help to raise interest.
Comment #72
RedRat CreditAttribution: RedRat commentedI will try this patch on my test D7 installation.
Comment #73
shane1090 CreditAttribution: shane1090 commentedI've have the patch running on my test D7 environment and it all seems to be working as it should at present but I'm still reviewing it.
Comment #74
benoit.pointet CreditAttribution: benoit.pointet commentedReviewed the patch. Works like a charm.
Comment #75
EAnushan CreditAttribution: EAnushan commentedPatch works as expected for me. Remember to run update.php after applying this patch. I'm running Drupal version 7.22.
Comment #76
EAnushan CreditAttribution: EAnushan commentedNoticed a problem with comment permissions. We're not using the "edit own comments" permission anywhere. As a result, the _forum_access_comment_edit_callback and _forum_access_comment_access_callback are returning incorrect values for these permissions. I went to my permissions and unchecked "edit own comments", but regular authenticated users can still edit their comments.
Also, I'm not sure if this is intended, but the "edit" link doesn't disappear even if the user does not have permission to use the link. Is this a result of chaining permissions together?
Comment #77
salvisFrom Permissions information:
I'm not sure whether #76 really concerns this feature request. Please open a new issue if it doesn't.
Comment #78
aitala CreditAttribution: aitala commentedReviewed the patch.. seems to do the trick on D7.22
Eric
Comment #79
Asome CreditAttribution: Asome commentedTried the patch in several sites, works like a charm, thanks :)
Comment #80
salvisGreat, thank you for the positive feedback.
As per #71 we have a few coding style issues, and we're missing tests. I've spent many days developing tests for close to 100% coverage (of the security-relevant code), and I won't commit such a change without proper test coverage.
Also, I haven't actually gone through the patch with the fine comb, so there may be more bumps ahead, but at this point we're blocked by #71.
Comment #81
C13L0 CreditAttribution: C13L0 commentedPatch works! Database needs to be updated after the patch is applied. Thanks so much =)
Comment #82
nonsieRe #71 - can you explain what exactly do you want the test(s) to contain? There are currently no explicit tests for view this forum, post in this forum, edit posts, delete posts permission so it would be the first. Test for Forum functionality (with FA and ACL) has been modified to account for this new permission already.
Attached is the screens for access control before and with the patch applied.
Can you explain what do you mean with "Please preserve the coding style: things that are aligned should remain aligned when a new (longer) item is inserted."?
Comment #83
salvisI'm not sure how you come to that conclusion — just look for comments like
// Check whether we can create a topic.
, thecreateForumCommentWithText()
method, and all the others. AFAIK we have full test coverage in the existing tests, and if we can separately allow posting topics and comments, then we need to test two additional combinations.Thank you for the screenshots:
BEFORE:
AFTER:
Looks good except for a minor issue in the help text:
Please replace
AND <em>Comment on posts</em>
with<strong>AND <em>Comment</em></strong>
. "Comment" stands on its own now and should be formatted like "Post".Here's an example:
The arrow operators used to line up and they should continue to line up. Whether you do that or not is a matter of personal preference, but if existing code is aligned, then you should not break the alignment.
What did you do with #41?
Comment #84
MXTI absolutely need this functionality so I applied patch in #69.
Initially, trying to edit a forum (/admin/structure/forum/edit/forum/XXX) I've received the following:
then, when I tried to add "comment on posts" permission and save the forum settings, I received:
So I manually had to create the 'grant_comment_create' column in 'forum_access' table and then all works fine: I can confirm that the patch does correctly its job
Please, add the missing table update and then commit this (every other forum out there has this functionality!)
Thank you very much
Comment #85
nonsieAttached patch takes care of the issues mentioned in #83 (help text formatting and aligning).
If you are using this patch, make sure to run database updates!
Re #41 - I could use some help with separating out the functionality in a sensible matter so that comment permission could be set per forum. It's the UI part that is the most complex as there is already a lot to configure a forum.
Comment #86
MXTI can confirm that:
Patch provided in #85 works great!
It applies cleanly on latest dev, and hook_update adds correctly new column on 'forum_access' table.
Again, please commit this!
Thank you very much
Comment #87
salvisI still see no test coverage of the new functionality.
Comment #88
Anonymous (not verified) CreditAttribution: Anonymous commentedPatch in #85 works for me too.
Comment #90
salvisFrom #85:
It has not addressed the other issues in #83.
Comment #91
toddwoof CreditAttribution: toddwoof commentedFor what it's worth, the patch in #85 appears to work as expected for me, as well. I can set post / comment permissions separately by role, for each forum, and the permissions appear to function properly when I test posting/commenting for users in different roles.
Comment #92
parasolx CreditAttribution: parasolx commentedI can confirm patch #85 works perfectly!
Comment #93
andrey_dver CreditAttribution: andrey_dver as a volunteer commentedI applied the patch #85, works good.
Comment #94
MrDaleSmith CreditAttribution: MrDaleSmith at CTI Digital commentedHave successfully used the patch in #85. just to comment that the code alignment change requested in #83 is against current Drupal coding standards, which is probably why it was changed.