Optimization in the setup: 10 queries to insert the 1500 action grant records

SVN:trunk[1153]
This commit is contained in:
Romain Quetiez
2011-03-29 14:43:22 +00:00
parent d4bfa4c48f
commit bdf46e8136

View File

@@ -148,11 +148,17 @@ class CreateITILProfilesInstaller extends ModuleInstallerAPI
// Grant read rights for everything
//
// Warning: BulkInsert is working because we will load one single class
// having one single table !
// the benefit is: 10 queries (1 per profile) instead of 1500
// which divides the overall user rights setup process by 2
DBObject::BulkInsertStart();
foreach (MetaModel::GetClasses('bizmodel') as $sClass)
{
self::DoCreateActionGrant($iProfile, UR_ACTION_READ, $sClass);
self::DoCreateActionGrant($iProfile, UR_ACTION_BULK_READ, $sClass);
}
DBObject::BulkInsertFlush();
// Grant write for given modules
// Start by compiling the information, because some modules may overlap