提交 0cbf67a1 authored 作者: Thomas Mueller's avatar Thomas Mueller

Formatting.

上级 415f3fe3
......@@ -187,13 +187,13 @@ public class GrantRevoke extends DefineCommand {
* @return true if this command is using Roles
*/
public boolean isRoleMode() {
return roleNames != null;
return roleNames != null;
}
/**
* @return true if this command is using Rights
*/
public boolean isRightMode() {
return rightMask != 0;
return rightMask != 0;
}
}
......@@ -212,9 +212,9 @@ public class User extends RightOwner {
* @throws DbException if this user is not a schema admin
*/
public void checkSchemaAdmin() {
if (!admin && !hasRight(null, Right.ALTER_ANY_SCHEMA)) {
throw DbException.get(ErrorCode.ADMIN_RIGHTS_REQUIRED);
}
if (!admin && !hasRight(null, Right.ALTER_ANY_SCHEMA)) {
throw DbException.get(ErrorCode.ADMIN_RIGHTS_REQUIRED);
}
}
@Override
......
......@@ -122,14 +122,12 @@ class WebSession {
DbContextRule tableRule = new DbContextRule(contents, DbContextRule.TABLE);
DbContextRule schemaRule = new DbContextRule(contents, DbContextRule.SCHEMA);
DbContextRule columnAliasRule = new DbContextRule(contents, DbContextRule.COLUMN_ALIAS);
DbContextRule procedureRule = new DbContextRule(contents, DbContextRule.PROCEDURE);
newBnf.updateTopic("column_name", columnRule);
newBnf.updateTopic("new_table_alias", newAliasRule);
newBnf.updateTopic("table_alias", aliasRule);
newBnf.updateTopic("column_alias", columnAliasRule);
newBnf.updateTopic("table_name", tableRule);
newBnf.updateTopic("schema_name", schemaRule);
// newBnf.updateTopic("expression", procedureRule);
newBnf.linkStatements();
bnf = newBnf;
} catch (Exception e) {
......
......@@ -201,8 +201,8 @@ public class TestRights extends TestBase {
}
private void testSchemaAdminRole() throws SQLException {
if (config.memory) {
return;
if (config.memory) {
return;
}
deleteDb("rights");
......@@ -223,12 +223,12 @@ public class TestRights extends TestBase {
/* try and fail */
conn = getConnection("rights;LOG=2", "SCHEMA_CREATOR", getPassword("xyz"));
stat = conn.createStatement();
assertThrows(ErrorCode.ADMIN_RIGHTS_REQUIRED, stat).
execute("CREATE SCHEMA SCHEMA_RIGHT_TEST_WILL_FAIL");
assertThrows(ErrorCode.ADMIN_RIGHTS_REQUIRED, stat).
execute("ALTER SCHEMA SCHEMA_RIGHT_TEST_EXISTS RENAME TO SCHEMA_RIGHT_TEST_WILL_FAIL");
assertThrows(ErrorCode.ADMIN_RIGHTS_REQUIRED, stat).
execute("DROP SCHEMA SCHEMA_RIGHT_TEST_EXISTS");
assertThrows(ErrorCode.ADMIN_RIGHTS_REQUIRED, stat).execute(
"CREATE SCHEMA SCHEMA_RIGHT_TEST_WILL_FAIL");
assertThrows(ErrorCode.ADMIN_RIGHTS_REQUIRED, stat).execute(
"ALTER SCHEMA SCHEMA_RIGHT_TEST_EXISTS RENAME TO SCHEMA_RIGHT_TEST_WILL_FAIL");
assertThrows(ErrorCode.ADMIN_RIGHTS_REQUIRED, stat).execute(
"DROP SCHEMA SCHEMA_RIGHT_TEST_EXISTS");
conn.close();
/* give them */
......@@ -257,9 +257,9 @@ public class TestRights extends TestBase {
conn = getConnection("rights;LOG=2", "SCHEMA_CREATOR", getPassword("xyz"));
stat = conn.createStatement();
assertThrows(ErrorCode.ADMIN_RIGHTS_REQUIRED, stat).
execute("CREATE SCHEMA SCHEMA_RIGHT_TEST");
execute("CREATE SCHEMA SCHEMA_RIGHT_TEST");
assertThrows(ErrorCode.ADMIN_RIGHTS_REQUIRED, stat).
execute("ALTER SCHEMA SCHEMA_RIGHT_TEST_EXISTS RENAME TO SCHEMA_RIGHT_TEST_RENAMED");
execute("ALTER SCHEMA SCHEMA_RIGHT_TEST_EXISTS RENAME TO SCHEMA_RIGHT_TEST_RENAMED");
assertThrows(ErrorCode.ADMIN_RIGHTS_REQUIRED, stat).
execute("DROP SCHEMA SCHEMA_RIGHT_TEST_EXISTS");
conn.close();
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论