Skip to content

Commit d4b6699

Browse files
committed
Fixed auth
1 parent 0fee061 commit d4b6699

2 files changed

Lines changed: 8 additions & 2 deletions

File tree

server/ast/drop_schema.go

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
package ast
1616

1717
import (
18+
"github.com/dolthub/doltgresql/server/auth"
1819
vitess "github.com/dolthub/vitess/go/vt/sqlparser"
1920

2021
"github.com/dolthub/doltgresql/postgres/parser/sem/tree"
@@ -43,5 +44,10 @@ func nodeDropSchema(ctx *Context, node *tree.DropSchema) (vitess.Statement, erro
4344
DBName: schemaName,
4445
CharsetCollate: nil,
4546
IfExists: node.IfExists,
47+
Auth: vitess.AuthInformation{
48+
AuthType: auth.AuthType_DELETE,
49+
TargetType: auth.AuthTargetType_SchemaIdentifiers,
50+
TargetNames: []string{"", schemaName},
51+
},
4652
}, nil
4753
}

testing/go/auth_quick_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -104,13 +104,13 @@ func TestAuthQuick(t *testing.T) {
104104
"CREATE SCHEMA newsch;",
105105
},
106106
},
107-
{ // This isn't supported yet, but it is supposed to fail since tester is not an owner
107+
{
108108
Queries: []string{
109109
"GRANT CREATE ON DATABASE postgres TO tester;",
110110
"CREATE SCHEMA newsch;",
111111
"DROP SCHEMA newsch;",
112112
},
113-
ExpectedErr: "not yet supported",
113+
ExpectedErr: "permission denied for schema",
114114
},
115115
{
116116
Queries: []string{

0 commit comments

Comments
 (0)