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

Im using permission2categories ( https://github.com/kfuchs/permission2categories )

in p2c_layer.php there are 

QA_USER_LEVEL_APPROVED => 'Anyone+',

QA_USER_LEVEL_EXPERT => 'Expert+',

QA_USER_LEVEL_EDITOR => 'Editor+',

QA_USER_LEVEL_MODERATOR => 'Moderator+',

QA_USER_LEVEL_ADMIN => 'Admin+',

QA_USER_LEVEL_SUPER => 'Super Admin'

But I want to use this for Registered or approved users.

is it enought if I add  this line 

QA_USER_LEVEL_APPROVED => 'MustApproved+',  

thanks

Q2A version: 1.8.3

1 Answer

+2 votes
by
selected by
 
Best answer

Your question has a minor issue and it is that the p2c-layer.php file does not exactly hold the content you are describing. Anyway, just use this content:

QA_USER_LEVEL_BASIC  => 'Registered+',
QA_USER_LEVEL_APPROVED  => 'Approved+',
QA_USER_LEVEL_EXPERT  => 'Expert+',
QA_USER_LEVEL_EDITOR => 'Editor+',
QA_USER_LEVEL_MODERATOR => 'Moderator+',
QA_USER_LEVEL_ADMIN  => 'Admin+',
QA_USER_LEVEL_SUPER  => 'Super Admin',

I took a very quick look at the plugin and it seems it should work as expected. Please, give it a try and report back.

by
edited by
First of all thank you Pupi
all lines are worked fine but this line QA_USER_LEVEL_BASIC  => 'Registered+', is deafult option and also anyone(not registered) still can see posts of category.
- Another issue is that users still can see categories which I restricted for them show on "Asking form"
by
+1
That seems to be unrelated to your question and this answer themselves. I mean, in the original plugin, do both of the issues you mention in your comment happen or not?
by
it works Pupi thank you.
I want to say that why  is registered user not different from unregistered user.
because I chose registered+ option , unregistered users still see posts why
by
+1
Check this: https://github.com/pupi1985/permission2categories/releases/tag/v1.1.0

If you want to get a better understanding of the changes, I've split them into small commits here: https://github.com/pupi1985/permission2categories/commits/master

BTW, make sure to enable the plugin from the admin settings (because now it CAN be disabled :D )
by
You did many changes pupi. thank you so much
But when I want to change option to another one , it does not update them.It gives same permission which I used with before plugin p2c
by
+1
Believe it or not, the metadata.json file is actually what broke it (the last commit). Try again with v1.1.1
by
+1
It works very good.
I dont know what to say. Thank you so much Pupi again.
it is amazing plugin
I believe you brother  :))
by
+1
@Pupi1985
Your upgrade is working fine with one problem only!
All users can post questions in that category, even if they are not supposedly permitted to.
However, once the posted, it becomes immediately invisible for them. So the can post, but they cannot see

They shoudl not also be able to post to.
...