Repository: mlflow/mlflow

Issue:
[BUG] No 'run_uuid' handling while validating user permissions
### Issues Policy acknowledgement

- [X] I have read and agree to submit bug reports in accordance with the [issues policy](https://www.github.com/mlflow/mlflow/blob/master/ISSUE_POLICY.md)

### Willingness to contribute

Yes. I would be willing to contribute a fix for this bug with guidance from the MLflow community.

### MLflow version

- Client: 2.3.2
- Tracking server: 2.3.2


### System information

- **OS Platform and Distribution (e.g., Linux Ubuntu 16.04)**:
- **Python version**:
- **yarn version, if running the dev UI**:


### Describe the problem

When login to the mlflow server as a non-admin user, mlflow checks user permissions before displaying run information ([here](https://github.com/gabrielfu/mlflow/blob/7490af79397922263c9580fd18fcc66daf8ffe18/mlflow/server/auth/__init__.py#L406)). It is implemented with use of `run_id` ([here](https://github.com/gabrielfu/mlflow/blob/7490af79397922263c9580fd18fcc66daf8ffe18/mlflow/server/auth/__init__.py#L249)). In case of the artifacts list, mlflow itself creates a response with `run_uuid` instead of `run_id`:

GET | http://localhost:5000/ajax-api/2.0/mlflow/artifacts/list?run_uuid=0707a3949a80428283cf9a39e62b3a46

As a result, user permissions validation fails [here](https://github.com/gabrielfu/mlflow/blob/7490af79397922263c9580fd18fcc66daf8ffe18/mlflow/server/auth/__init__.py#L208), because of `"error_code": "INVALID_PARAMETER_VALUE", "message": "Missing value for required parameter 'run_id'." `
So, non-admin users see this:
![image](https://github.com/mlflow/mlflow/assets/56647161/67d500ef-97ff-495a-a2bf-cdf9454b9e92)

Exactly the same problem occurs with metric history (it loads forever):
![image](https://github.com/mlflow/mlflow/assets/56647161/9391a19c-0365-4c75-83a0-993549b5ee84)


I think it is necessary to add `user_uuid` request parameter handling [here](https://github.com/gabrielfu/mlflow/blob/7490af79397922263c9580fd18fcc66daf8ffe18/mlflow/server/auth/__init__.py#L208) (something like [this](https://github.com/mlflow/mlflow/blob/2eba11c608db9c570e20cb0457c2928dcfc56f0a/mlflow/server/handlers.py#L543) or just try-catch block) or [here](https://github.com/gabrielfu/mlflow/blob/7490af79397922263c9580fd18fcc66daf8ffe18/mlflow/server/auth/__init__.py#L151) (something like [this](https://github.com/mlflow/mlflow/blob/2eba11c608db9c570e20cb0457c2928dcfc56f0a/mlflow/server/handlers.py#L438)).

With admin users everything works fine.

### Tracking information

<!-- PLEASE KEEP BACKTICKS AND CHECK PREVIEW -->
```shell
REPLACE_ME
```


### Code to reproduce issue

<!-- PLEASE KEEP BACKTICKS AND CHECK PREVIEW -->
```
REPLACE_ME
```


### Stack trace

<!-- PLEASE KEEP BACKTICKS AND CHECK PREVIEW -->
```
REPLACE_ME
```


### Other info / logs

<!-- PLEASE KEEP BACKTICKS AND CHECK PREVIEW -->
```
REPLACE_ME
```


### What component(s) does this bug affect?

- [ ] `area/artifacts`: Artifact stores and artifact logging
- [ ] `area/build`: Build and test infrastructure for MLflow
- [ ] `area/docs`: MLflow documentation pages
- [ ] `area/examples`: Example code
- [ ] `area/model-registry`: Model Registry service, APIs, and the fluent client calls for Model Registry
- [ ] `area/models`: MLmodel format, model serialization/deserialization, flavors
- [ ] `area/recipes`: Recipes, Recipe APIs, Recipe configs, Recipe Templates
- [ ] `area/projects`: MLproject format, project running backends
- [ ] `area/scoring`: MLflow Model server, model deployment tools, Spark UDFs
- [X] `area/server-infra`: MLflow Tracking server backend
- [X] `area/tracking`: Tracking Service, tracking client APIs, autologging

### What interface(s) does this bug affect?

- [X] `area/uiux`: Front-end, user experience, plotting, JavaScript, JavaScript dev server
- [ ] `area/docker`: Docker use across MLflow's components, such as MLflow Projects and MLflow Models
- [ ] `area/sqlalchemy`: Use of SQLAlchemy in the Tracking Service or Model Registry
- [ ] `area/windows`: Windows support

### What language(s) does this bug affect?

- [ ] `language/r`: R APIs and clients
- [ ] `language/java`: Java APIs and clients
- [ ] `language/new`: Proposals for new client languages

### What integration(s) does this bug affect?

- [ ] `integrations/azure`: Azure and Azure ML integrations
- [ ] `integrations/sagemaker`: SageMaker integrations
- [ ] `integrations/databricks`: Databricks integrations


Discussion:
@ka1mar Thanks for reporting this ! Exciting to see your fixing PR!

Resolving patch:
diff --git a/mlflow/server/auth/__init__.py b/mlflow/server/auth/__init__.py
--- a/mlflow/server/auth/__init__.py
+++ b/mlflow/server/auth/__init__.py
@@ -160,6 +160,9 @@ def _get_request_param(param: str) -> str:
         )
 
     if param not in args:
+        # Special handling for run_id
+        if param == "run_id":
+            return _get_request_param("run_uuid")
         raise MlflowException(
             f"Missing value for required parameter '{param}'. "
             "See the API docs for more information about request parameters.",


Test patch: