final int privilege_type = 5;
final int is_grantable = 6;
PersistentStore store = session.sessionData.getRowStore(t);
Iterator objects =
database.schemaManager.databaseObjectIterator(SchemaObject.TYPE);
OrderedHashSet grantees =
session.getGrantee().getGranteeAndAllRolesWithPublic();
while (objects.hasNext()) {
SchemaObject object = (SchemaObject) objects.next();
if (object.getType() != SchemaObject.TYPE) {
continue;
}
for (int i = 0; i < grantees.size(); i++) {
Grantee granteeObject = (Grantee) grantees.get(i);
OrderedHashSet rights =
granteeObject.getAllDirectPrivileges(object);
OrderedHashSet grants =
granteeObject.getAllGrantedPrivileges(object);
if (!grants.isEmpty()) {
grants.addAll(rights);
rights = grants;
}
for (int j = 0; j < rights.size(); j++) {