Browse Source

[s3] Do not require Hue admin privileges for FS access if RAZ is enabled

Romain Rigaux 4 years ago
parent
commit
998c7c3ac7
1 changed files with 5 additions and 1 deletions
  1. 5 1
      desktop/libs/aws/src/aws/conf.py

+ 5 - 1
desktop/libs/aws/src/aws/conf.py

@@ -346,7 +346,11 @@ def has_iam_metadata():
 
 
 def has_s3_access(user):
 def has_s3_access(user):
   from desktop.auth.backend import is_admin
   from desktop.auth.backend import is_admin
-  return user.is_authenticated and user.is_active and (is_admin(user) or user.has_hue_permission(action="s3_access", app="filebrowser"))
+  from desktop.conf import RAZ  # Must be imported dynamically in order to have proper value
+
+  return user.is_authenticated and user.is_active and (
+    is_admin(user) or user.has_hue_permission(action="s3_access", app="filebrowser") or RAZ.IS_ENABLED.get()
+  )
 
 
 
 
 def config_validator(user):
 def config_validator(user):