Title: current_user_can doesn&#8217;t work
Last modified: October 19, 2018

---

# current_user_can doesn’t work

 *  Resolved [matteobaro](https://wordpress.org/support/users/matteobaro/)
 * (@matteobaro)
 * [7 years, 7 months ago](https://wordpress.org/support/topic/current_user_can-doesnt-work/)
 * i have this code for tax exempt capabilities
 *     ```
         if (is_user_logged_in() && !is_admin()) {
       	add_filter( 'init', 'make_customer_tax_exempt' );
        }
        function make_customer_tax_exempt() {
       	global $woocommerce;
       	$tax_exempt = current_user_can( 'tax_exempt' );
       	$woocommerce->customer->set_is_vat_exempt( $tax_exempt );
        }
       ```
   
 * with user role editor work, with aam doesn’t work… how can i fix that ?

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

 *  Thread Starter [matteobaro](https://wordpress.org/support/users/matteobaro/)
 * (@matteobaro)
 * [7 years, 7 months ago](https://wordpress.org/support/topic/current_user_can-doesnt-work/#post-10796328)
 * for the entire user role works, but i need for single user and in this case it
   doesn’t work
 *  [Noel](https://wordpress.org/support/users/noelalvarez/)
 * (@noelalvarez)
 * [7 years, 7 months ago](https://wordpress.org/support/topic/current_user_can-doesnt-work/#post-10825482)
 * hi [@matteobaro](https://wordpress.org/support/users/matteobaro/),
 * This code you have added is adding tax exempt to all login users and not admin
   on your woocommerce site.
 * So if you want a tax exempt for a Single user you might want to get the right
   code from woocommerce support for this.

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

The topic ‘current_user_can doesn’t work’ is closed to new replies.

 * ![](https://ps.w.org/advanced-access-manager/assets/icon-256x256.png?rev=3447421)
 * [Advanced Access Manager – Access Governance for WordPress](https://wordpress.org/plugins/advanced-access-manager/)
 * [Support Threads](https://wordpress.org/support/plugin/advanced-access-manager/)
 * [Active Topics](https://wordpress.org/support/plugin/advanced-access-manager/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/advanced-access-manager/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/advanced-access-manager/reviews/)

 * 2 replies
 * 2 participants
 * Last reply from: [Noel](https://wordpress.org/support/users/noelalvarez/)
 * Last activity: [7 years, 7 months ago](https://wordpress.org/support/topic/current_user_can-doesnt-work/#post-10825482)
 * Status: resolved