Welcome to the Question2Answer Q&A. There's also a demo if you just want to try it out.
+5 votes
1.9k views
in Q2A Core by
How would assign one category to a specific group like admins or mods so only they could post in that category, it would be helpful for a type of news system.

3 Answers

+1 vote
by
 
Best answer
It's an interesting idea, but I'm afraid it's not currently possible to do this via the admin interface. But, you can do this via a minor code modification - in qa-page-ask.php, find this line:

$categoryoptions=qa_category_options($qa_db, $categories);

After that line, insert something like:

if ($qa_login_userid!=USER_ID_OF_SPECIAL_USER)
    unset($categoryoptions[CATEGORY_ID_OF_SPECIAL_CATEGORY]);

Replacing the capitalized phrases as appropriate, of course.

To complete this, you need to do the same thing in qa_page_q_edit_form() in qa-page-question-post.php, so most people also can't use the special category when editing their post. You'll also need to add $qa_login_userid to the list of global variables at the top of that function.
0 votes
by
I am unable to find
$categoryoptions=qa_category_options($qa_db, $categories);

in qa-page-ask.php

assigning a category to specific user/group is very important for most of the Q2A site.
+1 vote
by
There is a plugin which allows you to assign a specific permission level. You can download it here: https://github.com/kfuchs/permission2categories
...