diff --git a/backend/app/plugins/wiaas/includes/class-wiaas-authentication.php b/backend/app/plugins/wiaas/includes/class-wiaas-authentication.php index 5bb41e3..3b92f05 100644 --- a/backend/app/plugins/wiaas/includes/class-wiaas-authentication.php +++ b/backend/app/plugins/wiaas/includes/class-wiaas-authentication.php @@ -166,6 +166,12 @@ class Wiaas_Authentication { */ public static function authenticate_rest_user_on_login($data, $user) { + // if admin do nothing + if ($user->ID === self::SUPER_ADMIN_USER_ID) { + return new WP_Error('wiaas_authentication_error', 'No Customer permissions!', array( + 'status' => 403, + )); + } $role = user_can($user->ID, 'wiaas_customer') ? 'customer' : ''; $user->set_role($role);