Rename `set_data_dir_security_to_read_by_owner()` to

`set_data_dir_security_to_read_and_write_by_owner`
This commit is contained in:
shreyamalviya 2021-05-19 16:01:35 +05:30 committed by Shreya
parent 3201672248
commit e7a26aa2d1
1 changed files with 3 additions and 3 deletions

View File

@ -15,17 +15,17 @@ def create_data_dir(data_dir: str) -> None:
if not os.path.isdir(data_dir):
os.makedirs(data_dir, mode=0o700)
if is_windows_os: # `mode=0o700` doesn't work on Windows
set_data_dir_security_to_read_by_owner(data_dir_path=data_dir)
set_data_dir_security_to_read_and_write_by_owner(data_dir_path=data_dir)
def create_default_data_dir() -> None:
if not os.path.isdir(DEFAULT_DATA_DIR):
os.mkdir(DEFAULT_DATA_DIR, mode=0o700)
if is_windows_os: # `mode=0o700` doesn't work on Windows
set_data_dir_security_to_read_by_owner(data_dir_path=DEFAULT_DATA_DIR)
set_data_dir_security_to_read_and_write_by_owner(data_dir_path=DEFAULT_DATA_DIR)
def set_data_dir_security_to_read_by_owner(data_dir_path: str) -> None:
def set_data_dir_security_to_read_and_write_by_owner(data_dir_path: str) -> None:
user = get_user_pySID_object() # current user is newly created data dir's owner
security_descriptor = win32security.GetFileSecurity(