Changeset 584 for trunk/Modules/User
- Timestamp:
- Oct 31, 2013, 4:57:11 PM (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Modules/User/User.php
r565 r584 290 290 function CheckPermission($Module, $Operation, $ItemType = '', $ItemIndex = 0) 291 291 { 292 // Get module id 293 $DbResult = $this->Database->select('Module', 'Id', '`Name`="'.$Module.'"'); 294 if($DbResult->num_rows > 0) 295 { 296 $DbRow = $DbResult->fetch_assoc(); 297 $ModuleId = $DbRow['Id']; 298 } else return(false); 299 292 300 // First try to check cache 293 301 if(in_array(array($Module, $Operation, $ItemType, $ItemType), $this->PermissionCache)) … … 298 306 { 299 307 // If no permission combination exists in cache, do new check of database items 300 $DbResult = $this->Database->select('PermissionOperation', 'Id', '`Module`="'.$Module .'" AND `Item`="'.$ItemType.'" AND `ItemId`='.$ItemIndex.' AND `Operation`="'.$Operation.'"');308 $DbResult = $this->Database->select('PermissionOperation', 'Id', '`Module`="'.$ModuleId.'" AND `Item`="'.$ItemType.'" AND `ItemId`='.$ItemIndex.' AND `Operation`="'.$Operation.'"'); 301 309 if($DbResult->num_rows > 0) 302 310 { … … 456 464 'Table' => 'PermissionOperation', 457 465 'Items' => array( 458 'Module' => array('Type' => ' String', 'Caption' => 'Modul', 'Default' => ''),466 'Module' => array('Type' => 'TModule', 'Caption' => 'Modul', 'Default' => ''), 459 467 'Operation' => array('Type' => 'String', 'Caption' => 'Operace', 'Default' => ''), 460 468 'Item' => array('Type' => 'String', 'Caption' => 'Položka', 'Default' => ''),
Note:
See TracChangeset
for help on using the changeset viewer.