فهرست منبع

HUE-8758 [connector] Fill-up the connector FK of a Permission

Romain 5 سال پیش
والد
کامیت
3d93b6f647

+ 4 - 3
apps/about/src/about/templates/admin_wizard.mako

@@ -39,12 +39,13 @@ ${ layout.menubar(section='quick_start') }
     <div>
       <h1 class="margin-top-20 margin-bottom-30">
         % if is_admin(user):
-          ${ _('Quick Start Wizard') } -
+          ${ _('Quick Start') } -
         % endif
-        <a href="https://gethue.com" target="_blank" style="color:#777" title="${ _('Open Hue\'s website in a new tab') }">
+        <a href="https://gethue.com" target="_blank" title="${ _('Open Hue\'s website in a new tab') }">
           Hue&trade;
+          ${ version }
         </a>
-        ${ version } -
+        -
         Query. Explore. Repeat.
       </h1>
 

+ 4 - 2
apps/useradmin/src/useradmin/models.py

@@ -34,8 +34,8 @@ Permissions may be granted to groups, but not, currently, to users. A user's abi
 has access to.
 
 Note that Django itself has a notion of users, groups, and permissions. We re-use Django's notion of users and groups, but ignore its notion of
-permissions. The permissions notion in Django is strongly tied to what models you may or may not edit, and there are elaborations (especially
-in Django 1.2) to manipulate this row by row. This does not map nicely onto actions which may not relate to database models.
+permissions. The permissions notion in Django is strongly tied to what models you may or may not edit, and there are elaborations to
+manipulate this row by row. This does not map nicely onto actions which may not relate to database models.
 """
 import collections
 import json
@@ -270,6 +270,8 @@ def update_app_permissions(**kwargs):
             uptodate += 1
         else:
           new_dp = HuePermission(app=app_name, action=action, description=description)
+          if ENABLE_CONNECTORS.get():
+            new_dp.connector = Connector.objects.get(id=app_name)
           new_dp.save()
           added.append(new_dp)
 

+ 1 - 1
desktop/core/src/desktop/auth/backend.py

@@ -54,7 +54,7 @@ from desktop.settings import LOAD_BALANCER_COOKIE
 
 from useradmin import ldap_access
 from useradmin.organization import default_organization
-from useradmin.models import get_profile, get_default_user_group, UserProfile, User
+from useradmin.models import get_profile, get_default_user_group, UserProfile, User, get_organization
 
 
 LOG = logging.getLogger(__name__)

+ 12 - 11
desktop/core/src/desktop/lib/connectors/models.py

@@ -97,18 +97,19 @@ def _get_installed_connectors(category=None, categories=None, dialect=None, inte
         'is_demo': False,
       }
       for connector in Connector.objects.all()
-  ] + [ # TODO move to samples? or auto
-      {
-        'id': i,
-        'nice_name':  CONNECTORS.get()[i].NICE_NAME.get() or i,
-        'description': '',
-        'dialect': CONNECTORS.get()[i].DIALECT.get(),
-        'interface': CONNECTORS.get()[i].INTERFACE.get(),
-        'settings': CONNECTORS.get()[i].SETTINGS.get(),
-        'is_demo': True,
-      }
-      for i in CONNECTORS.get()
   ]
+  # + [ # TODO move to samples? or auto
+  #     {
+  #       'id': i,
+  #       'nice_name':  CONNECTORS.get()[i].NICE_NAME.get() or i,
+  #       'description': '',
+  #       'dialect': CONNECTORS.get()[i].DIALECT.get(),
+  #       'interface': CONNECTORS.get()[i].INTERFACE.get(),
+  #       'settings': CONNECTORS.get()[i].SETTINGS.get(),
+  #       'is_demo': True,
+  #     }
+  #     for i in CONNECTORS.get()
+  # ]
 
   for connector in connector_instances:
     connector_types = []