# WooCommerce redirects a user with HBook role to the front-end

<a id="blue-starhttps-maestrelatlassiannet-wiki-s-2141288751-6452-1a940726dccdfd22f4f3d128e6624577122d8c54-_-images-icons-emoticons-72-1f914png-problem"></a>

## ![(blue star)](https://maestrel.atlassian.net/wiki/s/-2141288751/6452/1a940726dccdfd22f4f3d128e6624577122d8c54/_/images/icons/emoticons/72/1f914.png)

 Problem

I use WooCommerce and a user with HBook role is redirected to WooCommerce "my-account" page.

<a id="blue-starhttps-maestrelatlassiannet-wiki-s-2141288751-6452-1a940726dccdfd22f4f3d128e6624577122d8c54-_-images-icons-emoticons-72-1f331png-solution"></a>

## ![(blue star)](https://maestrel.atlassian.net/wiki/s/-2141288751/6452/1a940726dccdfd22f4f3d128e6624577122d8c54/_/images/icons/emoticons/72/1f331.png)

 Solution

If you are using WooCommerce plugin and have created users with [HBook roles](../../browse-our-knowledgebase-by-topic/licence-user-roles/what-are-the-different-roles-added-by-hbook.md), you should prevent WooCommerce redirection after login.

Please add this code to the functions.php of your child theme:

```
/* Disable WC redirection after login */
add_filter( 'woocommerce_prevent_admin_access', 'hbook_reservation_role_admin_access' );
function hbook_reservation_role_admin_access( $prevent_access ) {
    if( current_user_can( 'read_resa' ) ) {
        $prevent_access = false;
    }
    return $prevent_access;
}
```