how to disable location background based on condition

I know this function [Location.startLocationUpdatesAsync] is for tracking location on appState == background, but how do we disable it based on some certain condition, like user roles