Esempio n. 1
0
 /**
  * Calculates the module type by bundle and module name
  * @param ModuleBase $module The module
  * @return string
  */
 static function ModuleType(ModuleBase $module)
 {
     return self::CalcModuleType($module->MyBundle(), $module->MyName());
 }
Esempio n. 2
0
 private function GrantOnModule(ModuleBase $module)
 {
     $bundle = $module->MyBundle();
     $moduleName = $module->MyName();
     $inList = $this->GetGroupList();
     $tblModLock = ModuleLock::Schema()->Table();
     $sql = Access::SqlBuilder();
     $where = $sql->Equals($tblModLock->Field('Bundle'), $sql->Value($bundle))->And_($sql->In($tblModLock->Field('UserGroup'), $inList))->And_($sql->Equals($tblModLock->Field('Module'), $sql->Value(''))->Or_($sql->Equals($tblModLock->Field('Module'), $sql->Value($moduleName))));
     if (ModuleLock::Schema()->Count(false, $where) > 0) {
         return GrantResult::NoAccess();
     }
     return GrantResult::Allowed();
 }