Page 1 of 1

When can custom capability be tested for?

PostPosted: May 2nd, 2011, 9:49 am
by sruefer
Hi,

I have a quick question concerning custom capabilities. I introduced the following access levels:

- Unregistered user (i.e. not registered at all)
- Level 0: free but registered
- Level 1: yearly payment
- Level 1 + custom capability "newsletter": yearly payment, different from Level 1

I am only running the site on my local machine for now, and I created test users for Level 0 and Level 1. I was not able to create a user for Level 1 + ccap="newsletter" (please advice on how to do that without actually going to Paypal), but I was testing for Level 1 + ccap="newsletter" for some pages and content. I noticed that nothing showed up for such tests.

Therefore I would like to check if I am correct in my assumption: an access level and/or custom capability can only be tested for if at least 1 user exists that has such access?

Thank you, kind regards,
Steffen

Re: When can custom capability be tested for?

PostPosted: May 2nd, 2011, 10:43 pm
by Cristián Lávaque
You can't test the access as an admin yet, so you have to have a test user with such access to test it.

You can create your test user normally and add the ccap to his profile later, you'll notice a field for that in the last part of the page.

I hope that helps. :)

Re: When can custom capability be tested for?

PostPosted: May 3rd, 2011, 12:13 am
by sruefer
Yes it worked, I overlooked that field when trying to modify the user.

Thanks a lot for pointing it out!
Steffen

Re: When can custom capability be tested for?

PostPosted: May 3rd, 2011, 2:03 am
by Cristián Lávaque
I'm glad it did. :)

Thanks for reporting back.