[wp-hackers] Checking users permissions and fetching data via AJAX

Dmitry Tokmakov dmitry at getmoxied.net
Wed May 30 18:41:40 UTC 2012


Thanks for respond! 
I did find out about cookies. It's cool that you mentioned about wp_ajax_nopriv_{action} this is exactly what I need,
Thanks! 

Dmitry
Digital Spin

On May 30, 2012, at 1:28 PM, scribu wrote:

> On Wed, May 30, 2012 at 12:48 AM, Dmitry Tokmakov <dmitry at getmoxied.net>wrote:
> 
>> I am currently building an API to fetch posts based on category via AJAX
>> and will need to check users permissions before to make sure they can
>> access the requested content.  Can someone lend some insight on how to send
>> the cookie with AJAX or another way of accessing the data that is
>> appropriate to the user based on permissions.
>> 
> 
> The cookies are sent automatically with each AJAX request, so you can use
> the same checks you would use normally.
> 
> Also note that if the user isn't logged in, the wp_ajax_nopriv_{action}
> will be fired instead.
> 
> -- 
> http://scribu.net
> _______________________________________________
> wp-hackers mailing list
> wp-hackers at lists.automattic.com
> http://lists.automattic.com/mailman/listinfo/wp-hackers



More information about the wp-hackers mailing list