Переглянути джерело

[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 10 роки тому
батько
коміт
b9567b3d28
1 змінених файлів з 4 додано та 3 видалено
  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, {