Esempio n. 1
0
 def index(self, req, tenant_id, instance_id):
     """Return all users."""
     LOG.info(_("Listing users for instance '%s'") % instance_id)
     LOG.info(_("req : '%s'\n\n") % req)
     context = req.environ[wsgi.CONTEXT_KEY]
     users, next_marker = models.Users.load(context, instance_id)
     view = views.UsersView(users)
     paged = pagination.SimplePaginatedDataView(req.url, 'users', view,
                                                next_marker)
     return wsgi.Result(paged.data(), 200)
Esempio n. 2
0
 def index(self, req, tenant_id, instance_id):
     """Return all users."""
     LOG.info("Listing users for instance '%(id)s'\n"
              "req : '%(req)s'\n\n",
              {"id": instance_id, "req": req})
     context = req.environ[wsgi.CONTEXT_KEY]
     self.authorize_target_action(context, 'user:index', instance_id)
     users, next_marker = models.Users.load(context, instance_id)
     view = views.UsersView(users)
     paged = pagination.SimplePaginatedDataView(req.url, 'users', view,
                                                next_marker)
     return wsgi.Result(paged.data(), 200)