Begin;
System "cp -f \"c:\\Program Files\\Ricoh\\TRMeister\\user.pswd\" \"c:\\Program Files\\Ricoh\\TRMeister\\test.pswd\"";
SetSystemParameter "Server_PasswordFilePath" "c:\\Program Files\\Ricoh\\TRMeister\\test.pswd";
Initialize;
InitializeSession  "TESTDB" "root" "doqadmin";
Command "create database TESTDB";
CreateUser "user1" "password1";
TerminateSession;
InitializeSession  "TESTDB" "root" "doqadmin";
Command "revoke system_operations, database_operations, data_operations, reference_operations from user1";
Command "grant system_operations to user1";
Command "select privilege from system_privilege where userid = 1";
Command "revoke system_operations from user1";
Command "select privilege from system_privilege where userid = 1";
TerminateSession;
InitializeSession  "TESTDB" "root" "doqadmin";
Command "revoke system_operations, database_operations, data_operations, reference_operations from user1";
Command "grant database_operations, reference_operations, system_operations, data_operations to user1";
Command "select privilege from system_privilege where userid = 1";
Command "revoke database_operations, reference_operations, data_operations, invalid_operations from user1";
Command "select privilege from system_privilege where userid = 1";
TerminateSession;
InitializeSession  "TESTDB" "root" "doqadmin";
Command "revoke system_operations, database_operations, data_operations, reference_operations from user1";
Command "grant database_operations, reference_operations to user1";
Command "select privilege from system_privilege where userid = 1";
Command "revoke system_operations, data_operations, invalid_operations from user1";
Command "select privilege from system_privilege where userid = 1";
TerminateSession;
InitializeSession  "TESTDB" "root" "doqadmin";
Command "revoke system_operations, database_operations, data_operations, reference_operations from user1";
Command "grant database_operations, data_operations to user1";
Command "select privilege from system_privilege where userid = 1";
Command "revoke database_operations, reference_operations from user1";
Command "select privilege from system_privilege where userid = 1";
TerminateSession;
InitializeSession  "TESTDB" "root" "doqadmin";
Command "revoke system_operations, database_operations, data_operations, reference_operations from user1";
Command "grant reference_operations, data_operations to user1";
Command "select privilege from system_privilege where userid = 1";
Command "revoke database_operations, data_operations, invalid_operations from user1";
Command "select privilege from system_privilege where userid = 1";
TerminateSession;
InitializeSession  "TESTDB" "root" "doqadmin";
Command "revoke system_operations, database_operations, data_operations, reference_operations from user1";
Command "grant database_operations, data_operations to user1";
Command "select privilege from system_privilege where userid = 1";
Command "revoke reference_operations, data_operations from user1";
Command "select privilege from system_privilege where userid = 1";
TerminateSession;
InitializeSession  "TESTDB" "root" "doqadmin";
Command "revoke system_operations, database_operations, data_operations, reference_operations from user1";
Command "grant database_operations, reference_operations, data_operations to user1";
Command "select privilege from system_privilege where userid = 1";
Command "revoke data_operations, invalid_operations from user1";
Command "select privilege from system_privilege where userid = 1";
TerminateSession;
InitializeSession  "TESTDB" "root" "doqadmin";
Command "revoke system_operations, database_operations, data_operations, reference_operations from user1";
Command "grant reference_operations to user1";
Command "select privilege from system_privilege where userid = 1";
Command "revoke database_operations, reference_operations, data_operations from user1";
Command "select privilege from system_privilege where userid = 1";
TerminateSession;
InitializeSession  "TESTDB" "root" "doqadmin";
Command "revoke system_operations, database_operations, data_operations, reference_operations from user1";
Command "grant reference_operations, system_operations, data_operations to user1";
Command "select privilege from system_privilege where userid = 1";
Command "revoke reference_operations, data_operations from user1";
Command "select privilege from system_privilege where userid = 1";
TerminateSession;
InitializeSession  "TESTDB" "root" "doqadmin";
Command "revoke system_operations, database_operations, data_operations, reference_operations from user1";
Command "grant database_operations, system_operations to user1";
Command "select privilege from system_privilege where userid = 1";
Command "revoke database_operations, reference_operations, invalid_operations from user1";
Command "select privilege from system_privilege where userid = 1";
TerminateSession;
InitializeSession  "TESTDB" "root" "doqadmin";
Command "revoke system_operations, database_operations, data_operations, reference_operations from user1";
Command "grant database_operations, data_operations to user1";
Command "select privilege from system_privilege where userid = 1";
Command "revoke database_operations, reference_operations, system_operations, data_operations, invalid_operations from user1";
Command "select privilege from system_privilege where userid = 1";
TerminateSession;
InitializeSession  "TESTDB" "root" "doqadmin";
Command "revoke system_operations, database_operations, data_operations, reference_operations from user1";
Command "grant database_operations, reference_operations to user1";
Command "select privilege from system_privilege where userid = 1";
Command "revoke database_operations from user1";
Command "select privilege from system_privilege where userid = 1";
TerminateSession;
InitializeSession  "TESTDB" "root" "doqadmin";
Command "revoke system_operations, database_operations, data_operations, reference_operations from user1";
Command "grant database_operations, reference_operations, data_operations to user1";
Command "select privilege from system_privilege where userid = 1";
Command "revoke database_operations, reference_operations, system_operations from user1";
Command "select privilege from system_privilege where userid = 1";
TerminateSession;
InitializeSession  "TESTDB" "root" "doqadmin";
Command "revoke system_operations, database_operations, data_operations, reference_operations from user1";
Command "grant data_operations to user1";
Command "select privilege from system_privilege where userid = 1";
Command "revoke database_operations, data_operations, invalid_operations from user1";
Command "select privilege from system_privilege where userid = 1";
TerminateSession;
InitializeSession  "TESTDB" "root" "doqadmin";
Command "revoke system_operations, database_operations, data_operations, reference_operations from user1";
Command "grant reference_operations, data_operations to user1";
Command "select privilege from system_privilege where userid = 1";
Command "revoke system_operations from user1";
Command "select privilege from system_privilege where userid = 1";
TerminateSession;
InitializeSession  "TESTDB" "root" "doqadmin";
Command "revoke system_operations, database_operations, data_operations, reference_operations from user1";
Command "grant database_operations, reference_operations to user1";
Command "select privilege from system_privilege where userid = 1";
Command "revoke database_operations, reference_operations, data_operations, invalid_operations from user1";
Command "select privilege from system_privilege where userid = 1";
TerminateSession;
InitializeSession  "TESTDB" "root" "doqadmin";
Command "revoke system_operations, database_operations, data_operations, reference_operations from user1";
Command "grant database_operations to user1";
Command "select privilege from system_privilege where userid = 1";
Command "revoke database_operations, reference_operations, data_operations from user1";
Command "select privilege from system_privilege where userid = 1";
TerminateSession;
InitializeSession  "TESTDB" "root" "doqadmin";
Command "revoke system_operations, database_operations, data_operations, reference_operations from user1";
Command "grant database_operations, reference_operations, data_operations to user1";
Command "select privilege from system_privilege where userid = 1";
Command "revoke reference_operations, invalid_operations from user1";
Command "select privilege from system_privilege where userid = 1";
TerminateSession;
InitializeSession  "TESTDB" "root" "doqadmin";
Command "revoke system_operations from root";
Command "revoke system_operations from user1, user2";
TerminateSession;
InitializeSession  "TESTDB" "user1" "password1";
Command "revoke system_operations from user1";
TerminateSession;
InitializeSession  "TESTDB" "root" "doqadmin";
DropUser "user1";
Command "drop database TESTDB";
TerminateSession;
Terminate;
System "rm -f \"c:\\Program Files\\Ricoh\\TRMeister\\test.pswd\"";
End;
