Ekimart078 commited on
Commit
fab266d
·
1 Parent(s): 5329ce8

Remove automatic permission correction logic from `yaml_config_is_valid` function for simplification.

Browse files
Files changed (1) hide show
  1. core/settings/settings.py +0 -27
core/settings/settings.py CHANGED
@@ -1,5 +1,4 @@
1
  import os
2
- import stat
3
  from pathlib import Path
4
  from typing import Any, Dict, Optional
5
 
@@ -61,32 +60,6 @@ class Settings:
61
  )
62
  return False
63
 
64
- mode = path.stat().st_mode
65
-
66
- modified = False
67
-
68
- if mode & (stat.S_IWOTH | stat.S_IROTH):
69
- self._logger.warning(
70
- "⚠️ Permissions incorrectes pour 'others', correction automatique en lecture seule."
71
- )
72
- mode = mode & ~(stat.S_IWOTH | stat.S_IROTH)
73
- modified = True
74
-
75
- if mode & stat.S_IWGRP:
76
- self._logger.warning(
77
- "⚠️ Permissions incorrectes pour 'group', correction automatique en lecture seule."
78
- )
79
- mode = mode & ~stat.S_IWGRP
80
- modified = True
81
-
82
- if modified:
83
- try:
84
- os.chmod(path, mode)
85
- self._logger.info(f"🔧 Permissions corrigées automatiquement.")
86
- except Exception as e:
87
- self._logger.error(f"🛑 Échec de la correction des permissions : {e}")
88
- return False
89
-
90
  return True
91
 
92
  return False
 
1
  import os
 
2
  from pathlib import Path
3
  from typing import Any, Dict, Optional
4
 
 
60
  )
61
  return False
62
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
63
  return True
64
 
65
  return False