diff --git a/pom.xml b/pom.xml index e1d0dd3..4d9f213 100644 --- a/pom.xml +++ b/pom.xml @@ -18,7 +18,7 @@ - 4.1.0-RC.26 + 4.1.0-RC.40 true true 1.0.0-RC.13 @@ -32,7 +32,7 @@ com.kingsrook qbit-build-parent - 2.2.1 + 2.3.0-RC.1 com.kingsrook.qbits @@ -265,7 +265,7 @@ true - 4.1.0-RC.26 + 4.1.0-RC.40 diff --git a/src/test/java/com/kingsrook/qbits/sqlworkbench/metadata/TableSecurityMatrixTest.java b/src/test/java/com/kingsrook/qbits/sqlworkbench/metadata/TableSecurityMatrixTest.java index 77e9b54..7098977 100644 --- a/src/test/java/com/kingsrook/qbits/sqlworkbench/metadata/TableSecurityMatrixTest.java +++ b/src/test/java/com/kingsrook/qbits/sqlworkbench/metadata/TableSecurityMatrixTest.java @@ -384,7 +384,7 @@ class TableSecurityMatrixTest extends BaseSqlWorkbenchTest QContext.getQSession().withPermission(table + ".insert").withPermission(table + ".edit").withPermission(table + ".delete"); Integer id = v1Query(table).get(0).getValueInteger("id"); assertThatThrownBy(() -> v1Update(table, id, Map.of("comment", "rewritten", "sqlText", "rewritten"))).as(user + " update " + table).isInstanceOf(QException.class); - assertThat(v1Delete(table, id)).as(user + " delete " + table).isZero(); + assertThatThrownBy(() -> v1Delete(table, id)).as(user + " delete " + table).isInstanceOf(QException.class); assertThatThrownBy(() -> tableInsert(table, Map.of("notebookId", ids.get("Private"), "versionNumber", 99, "executionUuid", "x"))).as(user + " insert " + table).isInstanceOf(QException.class); } } @@ -393,7 +393,7 @@ class TableSecurityMatrixTest extends BaseSqlWorkbenchTest login(OWNER); QContext.getQSession().withPermission(SqlWorkbenchResultSnapshot.TABLE_NAME + ".insert"); assertThatThrownBy(() -> tableInsert(SqlWorkbenchResultSnapshot.TABLE_NAME, Map.of("notebookId", ids.get("Private"), "resultJson", "{\"forged\":true}"))) - .isInstanceOf(QException.class).hasMessageContaining("pinned from the notebook"); + .isInstanceOf(QException.class).hasMessageContaining("cannot be added"); Integer snapshotId = v1Query(SqlWorkbenchResultSnapshot.TABLE_NAME).get(0).getValueInteger("id"); assertThat(v1Update(SqlWorkbenchResultSnapshot.TABLE_NAME, snapshotId, Map.of("label", "Payroll")).getValueString("label")).isEqualTo("Payroll"); assertThatThrownBy(() -> v1Update(SqlWorkbenchResultSnapshot.TABLE_NAME, snapshotId, Map.of("rowCount", 999))).isInstanceOf(QException.class); @@ -440,7 +440,9 @@ class TableSecurityMatrixTest extends BaseSqlWorkbenchTest // notebook edits through the table: versioned; visibility // // and system fields cannot be set directly // /////////////////////////////////////////////////////////////// - v1Update(SqlWorkbenchNotebook.TABLE_NAME, id, Map.of("description", "via the table", "currentVersion", 99)); + v1Update(SqlWorkbenchNotebook.TABLE_NAME, id, Map.of("description", "via the table")); + assertThat(currentVersion(id)).isEqualTo(5); + assertThatThrownBy(() -> v1Update(SqlWorkbenchNotebook.TABLE_NAME, id, Map.of("description", "forged version", "currentVersion", 99))).isInstanceOf(QException.class).hasMessageContaining("Current Version cannot be changed"); assertThat(currentVersion(id)).isEqualTo(5); assertThatThrownBy(() -> v1Update(SqlWorkbenchNotebook.TABLE_NAME, id, Map.of("visibility", "SHARED"))).isInstanceOf(QException.class); assertThatThrownBy(() -> v1Update(SqlWorkbenchNotebook.TABLE_NAME, id, Map.of("title", " "))).isInstanceOf(QException.class); @@ -581,7 +583,8 @@ class TableSecurityMatrixTest extends BaseSqlWorkbenchTest Integer shareId = shareOf(notebookId); login(OWNER); - QRecord retargeted = v1Update(SqlWorkbenchNotebookShare.TABLE_NAME, shareId, Map.of("audienceId", GROUP_MEMBER, "audienceKey", "all", "createdByUserId", "forged")); + assertThatThrownBy(() -> v1Update(SqlWorkbenchNotebookShare.TABLE_NAME, shareId, Map.of("audienceId", GROUP_MEMBER, "audienceKey", "all", "createdByUserId", "forged"))).isInstanceOf(QException.class); + QRecord retargeted = v1Update(SqlWorkbenchNotebookShare.TABLE_NAME, shareId, Map.of("audienceId", GROUP_MEMBER)); assertThat(retargeted.getValueString("audienceKey")).isEqualTo("user:reader-4"); login(GROUP_MEMBER); assertThat(v1Get(SqlWorkbenchNotebook.TABLE_NAME, notebookId).getValueString("title")).isEqualTo("For reader-3");