}
// Intermediate holders
String grantorName = SqlInvariants.SYSTEM_AUTHORIZATION_NAME;
Iterator grantees;
Grantee granteeObject;
String granteeName;
Iterator roles;
String isGrantable;
Object[] row;
// Column number mappings
final int role_name = 0;
final int grantee = 1;
final int grantor = 2;
final int is_grantable = 3;
// Initialization
grantees = session.getGrantee().visibleGrantees().iterator();
//
while (grantees.hasNext()) {
granteeObject = (Grantee) grantees.next();
granteeName = granteeObject.getName().getNameString();
roles = granteeObject.getDirectRoles().iterator();
isGrantable = granteeObject.isAdmin() ? Tokens.T_YES
: Tokens.T_NO;;
while (roles.hasNext()) {
Grantee role = (Grantee) roles.next();
row = t.getEmptyRowData();
row[role_name] = role.getName().getNameString();
row[grantee] = granteeName;
row[grantor] = grantorName;
row[is_grantable] = isGrantable;
t.insertSys(session, store, row);