Sobes.tech
Junior — Senior

Path validation and access blocking

livecode

Task condition

Analyze the work of the following code and suggest a comment that explains its purpose.

if model_path / PERMITTED_SUBPATH not in request_path.parents:
    raise django.core.exceptions.PermissionDenied()

Describe what is being checked in the condition and why an exception is raised in case of a mismatch.