Пример #1
0
    def add_routes(self, mapper):
        # Tenant Operations
        tenant_controller = controllers.Tenant()
        mapper.connect('/tenants',
                       controller=tenant_controller,
                       action='get_all_projects',
                       conditions=dict(method=['GET']))
        mapper.connect('/tenants/{tenant_id}',
                       controller=tenant_controller,
                       action='get_project',
                       conditions=dict(method=['GET']))

        # User Operations
        user_controller = controllers.User()
        mapper.connect('/users/{user_id}',
                       controller=user_controller,
                       action='get_user',
                       conditions=dict(method=['GET']))

        # Role Operations
        roles_controller = controllers.Role()
        mapper.connect('/tenants/{tenant_id}/users/{user_id}/roles',
                       controller=roles_controller,
                       action='get_user_roles',
                       conditions=dict(method=['GET']))
        mapper.connect('/users/{user_id}/roles',
                       controller=roles_controller,
                       action='get_user_roles',
                       conditions=dict(method=['GET']))
Пример #2
0
 def add_routes(self, mapper):
     # User Operations
     user_controller = controllers.User()
     mapper.connect('/users/{user_id}',
                    controller=user_controller,
                    action='get_user',
                    conditions=dict(method=['GET']))
Пример #3
0
 def setUp(self):
     super(UserTestCaseNoDefaultDomain, self).setUp()
     self.useFixture(database.Database())
     self.load_backends()
     self.user_controller = controllers.User()