Changing the admin of a contract using AccessControl

Hi everyone, if I have a contract like the following:

contract TestContract {
  bytes32 public constant OPERATOR = keccak256("OPERATOR");
  bytes32 public constant ADMIN = keccak256("ADMIN");

  constructor() {
    _setupRole(ADMIN, msg.sender);
    _setRoleAdmin(OPERATOR, ADMIN);
    * @dev The admin can choose to set the admin to someone else
  function switchOperator(address _operator) external onlyOperator {
    revokeRole(ADMIN, msg.sender);
    grantRole(ADMIN, _operator);

  // #### Modifiers
  modifier onlyOperator {
    require(hasRole(OPERATOR, msg.sender));

Is the above switchOperator(...) function the correct way to change the operator to somebody else? i.e. Change is such that onlyOperator(...) will succeed iff msg.sender == _operator where _operator is the address given to a call to switchOperator(...).

Thank you in advance.