code: def test_create_experiment_permission(store):
      username1 = random_str()
      password1 = random_str()
      user1 = _user_maker(store, username1, password1)
  
      experiment_id1 = random_str()
      user_id1 = user1.id
      permission1 = READ.name
      ep1 = _ep_maker(store, experiment_id1, username1, permission1)
      assert ep1.experiment_id == experiment_id1
      assert ep1.user_id == user_id1
      assert ep1.permission == permission1
  
      # error on duplicate
      with pytest.raises(
          MlflowException,
          match=rf"Experiment permission \(experiment_id={experiment_id1}, "
          rf"username={username1}\) already exists",
      ) as exception_context:
          _ep_maker(store, experiment_id1, username1, permission1)
      assert exception_context.value.error_code == ErrorCode.Name(
          RESOURCE_ALREADY_EXISTS
      )
  
      # slightly different name is ok
      experiment_id2 = random_str()
      ep2 = _ep_maker(store, experiment_id2, username1, permission1)
      assert ep2.experiment_id == experiment_id2
      assert ep2.user_id == user_id1
      assert ep2.permission == permission1
  
      # all permissions are ok
      for perm in ALL_PERMISSIONS:
          experiment_id3 = random_str()
          ep3 = _ep_maker(store, experiment_id3, username1, perm)
          assert ep3.experiment_id == experiment_id3
          assert ep3.user_id == user_id1
          assert ep3.permission == perm
  
      # invalid permission will fail
      experiment_id4 = random_str()
      with pytest.raises(
          MlflowException, match=r"Invalid permission"
      ) as exception_context:
          _ep_maker(
              store,
              experiment_id4,
              username1,
              "some_invalid_permission_string",
          )
      assert exception_context.value.error_code == ErrorCode.Name(
          INVALID_PARAMETER_VALUE
      )
  
imports: import pytest
  from mlflow.exceptions import MlflowException
  from mlflow.protos.databricks_pb2 import INVALID_PARAMETER_VALUE, RESOURCE_ALREADY_EXISTS, RESOURCE_DOES_NOT_EXIST, ErrorCode
  from mlflow.server.auth.entities import ExperimentPermission, RegisteredModelPermission, User
  from mlflow.server.auth.permissions import ALL_PERMISSIONS, EDIT, READ
  from mlflow.server.auth.sqlalchemy_store import SqlAlchemyStore
  from tests.helper_functions import random_str
label_desc: Use image node_id 12 for calling a global function with example usage: test_create_experiment_permission(store) without return types