Skip to content

Commit

Permalink
add test that owner privileges cannot be revoked
Browse files Browse the repository at this point in the history
  • Loading branch information
brennanjl committed Jan 24, 2025
1 parent 723c467 commit 5f761c7
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions node/engine/interpreter/interpreter_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -2342,6 +2342,10 @@ func Test_Ownership(t *testing.T) {
// default user cannot transfer ownership
err = interp.Execute(newEngineCtx(defaultCaller), tx, `TRANSFER OWNERSHIP TO 'user3';`, nil, nil)
require.ErrorIs(t, err, engine.ErrDoesNotHavePrivilege)

// it is impossible to revoke privileges from the owner, even if using WithoutCtx
err = interp.ExecuteWithoutEngineCtx(ctx, tx, `REVOKE insert FROM owner;`, nil, nil)
require.Contains(t, err.Error(), "owner role cannot have privileges revoked")
}

// This tests that the `notice` function works correctly, even when methods call an action that
Expand Down

0 comments on commit 5f761c7

Please sign in to comment.