Skip to content

Commit

Permalink
only check if file_name is there on role check
Browse files Browse the repository at this point in the history
  • Loading branch information
kshitijrajsharma committed Dec 7, 2023
1 parent 7ac9a7f commit d843078
Showing 1 changed file with 10 additions and 9 deletions.
19 changes: 10 additions & 9 deletions API/raw_data.py
Original file line number Diff line number Diff line change
Expand Up @@ -403,15 +403,16 @@ def get_osm_current_snapshot_as_file(
"""
if not (user.role is UserRole.STAFF.value or user.role is UserRole.ADMIN.value):
if "/" in params.file_name:
raise HTTPException(
status_code=403,
detail=[
{
"msg": "Insufficient Permission to use folder structure exports , Remove / from filename or get access"
}
],
)
if params.file_name:
if "/" in params.file_name:
raise HTTPException(
status_code=403,
detail=[
{
"msg": "Insufficient Permission to use folder structure exports , Remove / from filename or get access"
}
],
)
area_m2 = area(json.loads(params.geometry.json()))
area_km2 = area_m2 * 1e-6
RAWDATA_CURRENT_POLYGON_AREA = int(EXPORT_MAX_AREA_SQKM)
Expand Down

0 comments on commit d843078

Please sign in to comment.