Changeset: 114a881b6aea for MonetDB URL: https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=114a881b6aea Modified Files: sql/test/Users/Tests/grantPrivilegesNonDefaultRole.Bug-3365.SQL.py Branch: mtest Log Message:
Fixed this test: - use the correct description for the test - make sure it's the expected query that fails, and with the expected error - removed old python code in comments diffs (54 lines): diff --git a/sql/test/Users/Tests/grantPrivilegesNonDefaultRole.Bug-3365.SQL.py b/sql/test/Users/Tests/grantPrivilegesNonDefaultRole.Bug-3365.SQL.py --- a/sql/test/Users/Tests/grantPrivilegesNonDefaultRole.Bug-3365.SQL.py +++ b/sql/test/Users/Tests/grantPrivilegesNonDefaultRole.Bug-3365.SQL.py @@ -1,6 +1,7 @@ ### -# Let a user inherit the rights of monetdb. -# Check that by assuming the monetdb role the user has complete privileges (e.g. select, create, drop). +# Check that, if a user has a non-default current_role that is the schema +# authorization for the current_schema, the user will still be able to grant +# object privileges on tables in the current_schema. ### from MonetDBtesting.sqltest import SQLTestCase @@ -19,38 +20,8 @@ with SQLTestCase() as tc: tc.execute(""" set role hr_role; create table employees (id bigint,name varchar(20)); - grant select on employees to clark from current_role; """).assertSucceeded() - tc.execute(""" - set role hr_role; - grant select on employees to clark; - """).assertFailed() - -# import os, sys -# try: -# from MonetDBtesting import process -# except ImportError: -# import process + tc.execute("grant select on employees to clark;").assertFailed(err_code="01007", err_message="GRANT: Grantor 'blake' is not allowed to grant privileges for table 'employees'") + tc.execute("grant select on employees to clark from current_role;").assertSucceeded() -# def sql_test_client(user, passwd, input): -# with process.client(lang="sql", user=user, passwd=passwd, communicate=True, -# stdin=process.PIPE, stdout=process.PIPE, stderr=process.PIPE, -# input=input, port=int(os.getenv("MAPIPORT"))) as c: -# c.communicate() - -# sql_test_client('monetdb', 'monetdb', input="""\ -# create role hr_role; -# create schema hr authorization hr_role; -# create user blake with password 'password' name 'Blake' schema "hr"; -# create user clark with password 'password' name 'Clark' schema "hr"; -# grant hr_role to blake; -# """) - -# sql_test_client('blake', 'password', input="""\ -# set role hr_role; -# create table employees (id bigint,name varchar(20)); -# grant select on employees to clark; -# grant select on employees to clark from current_role; -# """) - _______________________________________________ checkin-list mailing list checkin-list@monetdb.org https://www.monetdb.org/mailman/listinfo/checkin-list