contract RBACOperator is Ownable, RBAC {

  /**
   * A constant role name for indicating operator.
   */
  string public constant ROLE_OPERATOR = "operator";

  address public partner;
  /**
   * Event for setPartner logging
   * @param oldPartner the old  Partner
   * @param newPartner the new  Partner
   */
  event SetPartner(address oldPartner, address newPartner);

  /**
   * @dev Throws if called by any account other than the owner or the Partner.
   */
  modifier onlyOwnerOrPartner() {
    require(msg.sender == owner || msg.sender == partner);
    _;
  }

  /**
   * @dev Throws if called by any account other than the Partner.
   */
  modifier onlyPartner() {
    require(msg.sender == partner);
    _;
  }


  /**
   * @dev setPartner, set the  partner address.
   * @param _partner the new  partner address.
   */
  function setPartner(address _partner) public onlyOwner {
    require(_partner != address(0));
    emit SetPartner(partner, _partner);
    partner = _partner;
  }


  /**
   * @dev removePartner, remove  partner address.
   */
  function removePartner() public onlyOwner {
    delete partner;
  }

  /**
   * @dev the modifier to operate
   */
  modifier hasOperationPermission() {
    checkRole(msg.sender, ROLE_OPERATOR);
    _;
  }



  /**
   * @dev add a operator role to an address
   * @param _operator address
   */
  function addOperater(address _operator) public onlyOwnerOrPartner {
    addRole(_operator, ROLE_OPERATOR);
  }

  /**
   * @dev remove a operator role from an address
   * @param _operator address
   */
  function removeOperater(address _operator) public onlyOwnerOrPartner {
    removeRole(_operator, ROLE_OPERATOR);
  }
}
function addOperater(address _operator) public onlyOwnerOrPartner {
  addRole(_operator, ROLE_OPERATOR);
}

/**
 * @dev add a operator role to an address
 * @param _operator address
 */