Explorar el Código

[hbase] Allow users to drop or edit HBase tables when impersonation is ON

Underlying permissions of HBase will be automatically enforced by HBase.
Romain Rigaux hace 10 años
padre
commit
b9567b3
Se han modificado 1 ficheros con 4 adiciones y 3 borrados
  1. 4 3
      apps/hbase/src/hbase/views.py

+ 4 - 3
apps/hbase/src/hbase/views.py

@@ -15,7 +15,6 @@
 # See the License for the specific language governing permissions and
 # limitations under the License.
 
-
 import base64
 import json
 import logging
@@ -30,16 +29,18 @@ from django.utils.translation import ugettext as _
 from desktop.lib.django_util import JsonResponse, render
 
 from hbase import conf
+from hbase.hbase_site import is_impersonation_enabled
 from hbase.settings import DJANGO_APPS
 from hbase.api import HbaseApi
 from hbase.management.commands import hbase_setup
-from server.hbase_lib import get_thrift_type
+from hbase.server.hbase_lib import get_thrift_type
+
 
 LOG = logging.getLogger(__name__)
 
 
 def has_write_access(user):
-  return user.is_superuser or user.has_hue_permission(action="write", app=DJANGO_APPS[0])
+  return user.is_superuser or user.has_hue_permission(action="write", app=DJANGO_APPS[0]) or is_impersonation_enabled()
 
 def app(request):
   return render('app.mako', request, {