Эх сурвалжийг харах

[useradmin] Permission to view the user profile of another user:

Romain Rigaux 10 жил өмнө
parent
commit
0cae7afa77

+ 1 - 1
apps/metastore/src/metastore/templates/describe_table.mako

@@ -250,7 +250,7 @@ ${ assist.assistPanel() }
                     <div class="row-fluid">
                       <div class="span6">
                         <div title="${ _('Owner') }">
-                          <a href="/useradmin/users/view/${ table.details['properties'].get('owner') }">
+                          <a href="/useradmin/view_user/${ table.details['properties'].get('owner') }">
                             <i class="fa fa-fw fa-user muted"></i> ${ table.details['properties'].get('owner') }
                           </a>
                         </div>

+ 1 - 0
apps/useradmin/src/useradmin/settings.py

@@ -22,4 +22,5 @@ MENU_INDEX = 60
 
 PERMISSION_ACTIONS = (
   ("access_view:useradmin:edit_user", "Access to profile page on User Admin"),
+  ("access_view:useradmin:view_user", "Access to any profile page on User Admin"),
 )

+ 1 - 1
apps/useradmin/src/useradmin/urls.py

@@ -28,7 +28,7 @@ urlpatterns = patterns('useradmin.views',
   url(r'^groups$', 'list_groups'),
   url(r'^permissions$', 'list_permissions'),
   url(r'^users/edit/(?P<username>%s)$' % (username_re,), 'edit_user'),
-  url(r'^users/view/(?P<username>%s)$' % (username_re,), 'view_user'),
+  url(r'^view_user/(?P<username>%s)$' % (username_re,), 'view_user'),
   url(r'^users/add_ldap_users$', 'add_ldap_users'),
   url(r'^users/add_ldap_groups$', 'add_ldap_groups'),
   url(r'^users/sync_ldap_users_groups$', 'sync_ldap_users_groups'),

+ 2 - 2
desktop/core/src/desktop/views.py

@@ -166,10 +166,10 @@ def bootstrap(request):
   """Concatenates bootstrap.js files from all installed Hue apps."""
 
   # Has some None's for apps that don't have bootsraps.
-  all_bootstraps = [ (app, app.get_bootstrap_file()) for app in appmanager.DESKTOP_APPS if request.user.has_hue_permission(action="access", app=app.name) ]
+  all_bootstraps = [(app, app.get_bootstrap_file()) for app in appmanager.DESKTOP_APPS if request.user.has_hue_permission(action="access", app=app.name)]
 
   # Iterator over the streams.
-  concatenated = [ "\n/* %s */\n%s" % (app.name, b.read()) for app, b in all_bootstraps if b is not None ]
+  concatenated = ["\n/* %s */\n%s" % (app.name, b.read()) for app, b in all_bootstraps if b is not None]
 
   # HttpResponse can take an iteratable as the first argument, which
   # is what happens here.