// Add connection permissions
for (String identifier : configs.keySet()) {
// Create permission
Permission permission = new ConnectionPermission(
ObjectPermission.Type.READ,
identifier
);
// Add to set
permissions.add(permission);
}
// Add group permissions
for (ConnectionGroup group : groups) {
// Create permission
Permission permission = new ConnectionGroupPermission(
ObjectPermission.Type.READ,
group.getIdentifier()
);
// Add to set