//create new class
OClass documentClass = db.getMetadata().getSchema().getClass(CLASS_NODE_NAME);
db.getMetadata().getSchema().createClass(collectionName, documentClass);
//grants to the new class
ORole registeredRole = RoleDao.getRole(DefaultRoles.REGISTERED_USER.toString());
ORole anonymousRole = RoleDao.getRole(DefaultRoles.ANONYMOUS_USER.toString());
registeredRole.addRule(ODatabaseSecurityResources.CLASS + "." + collectionName, ORole.PERMISSION_ALL);
registeredRole.addRule(ODatabaseSecurityResources.CLUSTER + "." + collectionName, ORole.PERMISSION_ALL);
anonymousRole.addRule(ODatabaseSecurityResources.CLASS + "." + collectionName, ORole.PERMISSION_READ);
anonymousRole.addRule(ODatabaseSecurityResources.CLUSTER + "." + collectionName, ORole.PERMISSION_READ);
PermissionsHelper.grantRead(doc, registeredRole);
PermissionsHelper.grantRead(doc, anonymousRole);
if (Logger.isTraceEnabled()) Logger.trace("Method End");
return doc;
}//getNewModelInstance(String collectionName)