Welcome to the Question2Answer Q&A. There's also a demo if you just want to try it out.
+2 votes
899 views
in Q2A Core by

Unfortunately, in the admin options there is only to find: >Posting | "Allow questions to be manually closed"

So either it'd be good to have a choice under: >Permissions to select who can close, or add under >Postings a 2nd entry: Allow questions to be manually closed only by admin

so long,
Kai

2 Answers

+1 vote
by
edited by

solved by adding a hack to the core file: qa-include/qa-page-question-view.php:

- search function qa_page_q_post_rules()

- add right after line:
$rules['followable']=($post['type']=='A') ? qa_opt('follow_on_as') : false;

- this line:
        // only admin can close questions (and check if question is already closed)
        $rules['closeable'] = ($level>=QA_USER_LEVEL_ADMIN) && (!$rules['closed']);

 

by
Hi,

Ver.1.6.2
Theme: Pixel n Grain Dark V D1.1

i find an issue for this code. This work nice but :

1- When the admin close a question, the own user who is connected, can just recategorize. (must to be hide also).  

Only the admin can be reopen maybe is a good idea.

2- When the admin close a question, another user who is connected can do all function: recategorize,flag,reopen,hide. (must to hide this possibilities to another user)

When the question is closed, only admin can get full privilege to recategorize,flag,reopen,hide.

This is possible ?

Thank you.
0 votes
by

Thanks q2apro, that also solved my problem. For 1.7.2 and higher, it should be:

$rules['closeable'] = (qa_get_logged_in_level()>=QA_USER_LEVEL_ADMIN) && (!$rules['closed']);

But I don't know why I can't limt permission to close question from EXPERT and higher:

$rules['closeable'] = (qa_get_logged_in_level()>=QA_USER_LEVEL_EXPERT) && (!$rules['closed']);

Above doesn't work, I used it on my site and only the Admin and MOD can close question while it should be Expert and Editor too

...