> For the complete documentation index, see [llms.txt](https://hacking-notes.jord4n.pro/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://hacking-notes.jord4n.pro/es/web/access-control/change-role-in-user-profile.md).

# Cambiar el rol en el perfil de usuario

### El rol de usuario se puede modificar en el perfil de usuario

Este laboratorio contiene un panel de administración ubicado en **/admin**, accesible solo para usuarios conectados con un **roleid = 2**. / La misión es modificar nuestro propio rol, acceder a la interfaz de administración y eliminar al usuario **carlos**.

1. Nos conectamos con las credenciales proporcionadas\:/ **wiener: peter**
2. En la sección de perfil, el cambio de dirección de correo electrónico se envía mediante una solicitud JSON, por ejemplo:

```json
{
"email":"jordan@test.com"
}
```

La respuesta devuelve estos datos directamente a JSON, lo que demuestra que no se aplica un filtrado estricto.

<figure><img src="/files/4492c7fb65e5bf9c2bdce21a2d266dbdc1e0f588" alt=""><figcaption></figcaption></figure>

Al inyectar un parámetro adicional **roleid**, probamos:

```json
{
"email":"jordan@test.com",
"roleid": 2
}
```

5. El servidor acepta este cambio y devuelve un **302 Found**, confirmando que nuestro rol ha cambiado a **2**.
6. Una vez promocionados a administrador, tenemos acceso a **/admin**, donde solo usamos la funcionalidad para **eliminar al usuario carlos** y así resolver el laboratorio.

<figure><img src="/files/90ec567ecbfeb73bf8328c4567c592b339b8c7e7" alt="" width="563"><figcaption></figcaption></figure>


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://hacking-notes.jord4n.pro/es/web/access-control/change-role-in-user-profile.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
