function _bp_enforce_bp_moderate_cap_for_admins( $caps = array(), $cap = '', $user_id = 0, $args = array() ) {
    	// Bail if not checking the 'bp_moderate' cap.
    	if ( 'bp_moderate' !== $cap ) {
    		return $caps;
    	}
    
    	// Bail if BuddyPress is not network activated.
    	if ( bp_is_network_activated() ) {
    		return $caps;
    	}
    
    	// Never trust inactive users.
    	if ( bp_is_user_inactive( $user_id ) ) {
    		return $caps;
    	}
    
    	// Only users that can 'manage_options' on this site can 'bp_moderate'.
    	return array( 'manage_options' );
    }
    add_filter( 'map_meta_cap', '_bp_enforce_bp_moderate_cap_for_admins', 10, 4 );

In the above code, the capability "bp_moderate" is mapped to "manage_options". This means any action that requires "bp_moderate" would be equivalent to requiring "manage_options". Now "manage_options" is too powerful, with it enabled, the user can do many things on the backend. I want to grant a certain user "bp_moderate" but without "manage_options" ability. So I am thinking to write a callback function to override the function above:

    function allow_daniel_edit( $caps = array(), $cap = '', $user_id = 0, $args = array() ) {
    	if ($user_id == 59) {
    		return $caps;
    	}
    	// Bail if not checking the 'bp_moderate' cap.
    	if ( 'bp_moderate' !== $cap ) {
    		return $caps;
    	}
    
    	// Bail if BuddyPress is not network activated.
    	if ( bp_is_network_activated() ) {
    		return $caps;
    	}
    
    	// Never trust inactive users.
    	if ( bp_is_user_inactive( $user_id ) ) {
    		return $caps;
    	}
    
    	// Only users that can 'manage_options' on this site can 'bp_moderate'.
    	return array( 'manage_options' );
    }
    add_filter( 'map_meta_cap', 'allow_daniel_edit', 999, 4 );

But this didn't work, because by the time my function executes, the $caps has been altered by the previous code and becomes "manage_options". So what should be the right way to do this?