latest stable versions: v150827 (changelog)

Old Forums (READ-ONLY): The community now lives at WP Sharks™. If you have an s2Member® Pro question, please use our new Support System.

Custom Capabilities always returning true

Home Forums Community Forum Custom Capabilities always returning true

This topic contains 3 replies, has 3 voices. Last updated by  Cristián Lávaque 4 years, 6 months ago.

Topic Author Topic
Posted: Saturday Jun 16th, 2012 at 2:41 pm #16690

I have implemented a simple redirect for Administrator users that do not have the cc of mcfddashboard, but for administrator the current_user_can always returns true for any type of custom capability.

current_user_can(‘access_s2member_ccap_asdf’)

current_user_can(‘access_s2member_ccap_blabla’)

current_user_can(‘access_s2member_ccap_*’) will always return true

Do CC work on Administrator users please?

List Of Topic Replies

Viewing 3 replies - 1 through 3 (of 3 total)
Author Replies
Author Replies
Posted: Sunday Jun 17th, 2012 at 11:10 am #16727
Eduan
Username: Eduan
Moderator

Hello Roderick,

I believe ccaps don’t work on admins, only on users. :/

Posted: Sunday Jun 17th, 2012 at 11:14 am #16728

Thanks Eduan,

It would have been very nice of S2 to specify this limitation :)

Any idea how I can limit only specific Admin users from access the wp-admin area please?

Thanks again Eduan

Posted: Tuesday Jun 19th, 2012 at 4:33 am #16838

Hi Roderick.

s2Member never applies restrictions to admins. If you need someone that’s like an admin, but with restrictions, you’d need to create a new role and give it all the WordPress capabilies, except for the ones you don’t want him to have. http://wordpress.org/extend/plugins/user-role-editor/

I hope that helps. :)

Viewing 3 replies - 1 through 3 (of 3 total)

This topic is closed to new replies. Topics with no replies for 2 weeks are closed automatically.

Old Forums (READ-ONLY): The community now lives at WP Sharks™. If you have an s2Member® Pro question, please use our new Support System.

Contacting s2Member: Please use our Support Center for bug reports, pre-sale questions & technical assistance.