diff --git a/src/jupyterhub_config/custom_spawner.py b/src/jupyterhub_config/custom_spawner.py index 0ba1e02..24e08ec 100644 --- a/src/jupyterhub_config/custom_spawner.py +++ b/src/jupyterhub_config/custom_spawner.py @@ -123,6 +123,11 @@ def _ensure_user_directory(self, user_dir: Path, username: str): # Set directory permissions to 750: Owner (rwx), Group (r-x), Others (---) os.chmod(user_dir, 0o750) + # Grand spark_user read/write access to the user's home directory + self.log.info(f'Granting read/write access to spark_user for {username}') + subprocess.run(['sudo', 'setfacl', '-m', f'u:spark_user:rwX', user_dir], check=True) + subprocess.run(['sudo', 'setfacl', '-m', f'u:root:rwX', user_dir], check=True) + else: self.log.info(f'Reusing user directory for {username}')