Function get_module_role

Source
pub async fn get_module_role(
    __arg0: State<AppState>,
    __arg1: AuthUser,
    __arg2: Query<ModuleRoleQuery>,
) -> impl IntoResponse
Expand description

GET /api/auth/module-role

Returns the role of the authenticated user in the given module, if any.

§Authorization

Requires a valid bearer token.

§Query Parameters

  • module_id: The module ID to check

§Response

{
  "success": true,
  "message": "Role fetched successfully",
  "data": {
    "role": "lecturer" // or "tutor", "student", null
  }
}

#[derive(Debug, Deserialize)]