Please upgrade here. These earlier versions are no longer being updated and have security issues.
HackerOne users: Testing against this community violates our program's Terms of Service and will result in your bounty being denied.
[GitHub #1051] How can I hide the 'Start a New Discussion'-button?
On my forum, members are only allowed to place comments on already opened threads. They are not allowed to start a new thread.
I set this up in the 'Roles & Permissions'-screen and everything works, but the 'Start a New Discussion'-button is still shown. How can I hide this button?
Please note: when an Administrator is logged in the button should be visible, since administrators are allowed to start a new thread.
I set this up in the 'Roles & Permissions'-screen and everything works, but the 'Start a New Discussion'-button is still shown. How can I hide this button?
Please note: when an Administrator is logged in the button should be visible, since administrators are allowed to start a new thread.
Tagged:
0
Best Answer
-
UnderDog MVPI'll sink the topic instead of closing it. If questions come up during development we can post them in here
There was an error rendering this rich post.
0
Answers
Let me put it otherwise: How can I read the current logged in user status, role and/or permissions? Because then I just edit
views/modules/newdiscussion.php
like:The following code solved it:
- I have adminstrators, who are king!
- I have moderators, who can start new threads (assigned by the adminstrator)
- I have members, who can only post comments on threads (they can register themselves)
- And all the 'guests' who can only read the forum, but not post comments (they need to register to do that).
So if somebody creates a login on the site, they are not allowed to create new threads, only comment on existing threads. I did this by unchecking the 'Add'-checkbox in the 'Roles & Permissions'-page » Members » Discussions. But the 'Start a New Discussion'-button was still visible. And clicking on the button resulted in an error that the user doesn't have the correct permissions.
Therefore I think this should be considered as a bug.
Just use what you wrote up there to create an issue on github for the project.
Otherwise, it will surely be forgotten.
please close this topic
There was an error rendering this rich post.
A non-logged in user clicks the "add discussion" button, they go to the form to add, but the form shows no categories available, and the user cannot post but there is no message to say why, it just reloads the form.