Conditional Component Expression by User Capability

I have defined a member_only_content capability and associated it to specific roles on my sight (this can be seen from the plugin interface I used here.

Now I’m trying to leverage this in Cornerstone to make a specific section visible only if the current user has this capability but I don’t see a way to do this. I’ve tried {{dc:user:meta key="member_only_content"}} but it returns no value. I’ve also tried {{ user.meta({"key":"wp_capabilities"}) }} but it seems to return an array containing the User Role.

Based on some details I found here I also tried {{ user.can('member_only_content') }} but it also doesn’t appear to provide any value

Really hoping there is a way to accomplish this but just need some guidance. Thanks!

Hello Nicholas,

Thanks for writing in! May I suggest that you check out J JSM Show Post Metadata to find out the correct post meta of the capabilities that you are trying to access using the dynamic content? We would also love to check out your set up if we can have access to it. You can create a secure note in your next reply with the following info:
– Link to your site
– WP login URL
– WP username
– WP password
– WP Administrator Role
– Confirmation that we can access and make changes to your site

To know how to create a secure note, please check this out: How The Forum Works

image

Best Regards.