use of org.hsqldb_voltpatches.lib.Set in project voltdb by VoltDB.
the class Grantee method nonReservedVisibleGrantees.
/**
* Set of all non-reserved visible grantees, including self. <p>
*
* For grantees with admin, this is all grantees.
* For regular grantees, this is self plus all roles granted directly
* or indirectly. <P>
*
* @param andPublic when <tt>true</tt> retains the reserved PUBLIC grantee
*/
public Set nonReservedVisibleGrantees(boolean andPublic) {
Set grantees = visibleGrantees();
GranteeManager gm = granteeManager;
grantees.remove(gm.dbaRole);
grantees.remove(GranteeManager.systemAuthorisation);
if (!andPublic) {
grantees.remove(gm.publicRole);
}
return grantees;
}
use of org.hsqldb_voltpatches.lib.Set in project voltdb by VoltDB.
the class DatabaseInformationFull method insertRoles.
private void insertRoles(Table t, Grantee role, boolean isGrantable) {
final int grantee = 0;
final int role_name = 1;
final int is_grantable = 2;
PersistentStore store = database.persistentStoreCollection.getStore(t);
if (isGrantable) {
Set roles = database.getGranteeManager().getRoleNames();
Iterator it = roles.iterator();
while (it.hasNext()) {
String roleName = (String) it.next();
Object[] row = t.getEmptyRowData();
row[grantee] = role.getNameString();
row[role_name] = roleName;
row[is_grantable] = "YES";
t.insertSys(store, row);
}
} else {
OrderedHashSet roles = role.getDirectRoles();
for (int i = 0; i < roles.size(); i++) {
String roleName = (String) roles.get(i);
Object[] row = t.getEmptyRowData();
row[grantee] = role.getNameString();
row[role_name] = roleName;
row[is_grantable] = Tokens.T_NO;
t.insertSys(store, row);
role = database.getGranteeManager().getRole(roleName);
insertRoles(t, role, isGrantable);
}
}
}
use of org.hsqldb_voltpatches.lib.Set in project voltdb by VoltDB.
the class HsqlDatabaseProperties method getUserDefinedPropertyData.
public Set getUserDefinedPropertyData() {
Set set = new HashSet();
Iterator it = meta.values().iterator();
while (it.hasNext()) {
Object[] row = (Object[]) it.next();
if (((Integer) row[indexType]).intValue() == SET_PROPERTY) {
set.add(row);
}
}
return set;
}
Aggregations