def setUpClass(cls):
        super().setUpClass()
        cls.role_with_permission = UserRole.create(
            cls.domain, 'edit-data', permissions=Permissions(edit_data=True)
        )
        cls.role_without_permission = UserRole.create(
            cls.domain, 'no-edit-data', permissions=Permissions(edit_data=False)
        )
        cls.role_with_permission_but_no_api_access = UserRole.create(
            cls.domain, 'no-api-access', permissions=Permissions(edit_data=True, access_api=False)
        )
        cls.domain_admin = WebUser.create(cls.domain, 'domain_admin', cls.password, None, None, is_admin=True)
        cls.user_with_permission = WebUser.create(cls.domain, 'permission', cls.password, None, None,
                                                  role_id=cls.role_with_permission.get_id)
        cls.user_without_permission = WebUser.create(cls.domain, 'no-permission', cls.password, None, None,
                                                     role_id=cls.role_without_permission.get_id)
        cls.user_with_permission_but_no_api_access = WebUser.create(
            cls.domain, 'no-api-access', cls.password, None, None,
            role_id=cls.role_with_permission_but_no_api_access.get_id,
        )