Beispiel #1
0
 def index(self, req, tenant_id, instance_id, user_id):
     """Show permissions for the given user."""
     LOG.info(_("Showing user access for instance '%s'") % instance_id)
     LOG.info(_("req : '%s'\n\n") % req)
     context = req.environ[wsgi.CONTEXT_KEY]
     # Make sure this user exists.
     user = self._get_user(context, instance_id, user_id)
     username, hostname = unquote_user_host(user_id)
     access = models.User.access(context, instance_id, username, hostname)
     view = views.UserAccessView(access.databases)
     return wsgi.Result(view.data(), 200)
Beispiel #2
0
 def index(self, req, tenant_id, instance_id, user_id):
     """Show permissions for the given user."""
     LOG.info(_("Showing user access for instance '%s'") % instance_id)
     LOG.info(_("req : '%s'\n\n") % req)
     context = req.environ[wsgi.CONTEXT_KEY]
     # Make sure this user exists.
     user_id = correct_id_with_req(user_id, req)
     user = self._get_user(context, instance_id, user_id)
     if not user:
         LOG.error(_("No such user: %(user)s ") % {'user': user})
         raise exception.UserNotFound(uuid=user)
     username, hostname = unquote_user_host(user_id)
     access = models.User.access(context, instance_id, username, hostname)
     view = views.UserAccessView(access.databases)
     return wsgi.Result(view.data(), 200)