Piotr Labudda 8 лет назад
Родитель
Сommit
c12b5dafab
1 измененных файлов с 7 добавлено и 7 удалено
  1. 7 7
      SE/se-lib/AntAclBase.php

+ 7 - 7
SE/se-lib/AntAclBase.php

@@ -192,27 +192,27 @@ class AntAclBase extends Core_AclBase {
 		return false; // TODO: $this->getAclInfo($fieldName); @see canReadField
 	}
 	public function getAclInfo($fieldName = null) {
-		static $_aclInfo = null; // [ fieldName => [ id => {idZasob}, perms => 'RWX...' ] // TODO: , sort_prio => {SORT_PRIO}, label => {CELL_LABEL}  ]
-		if (null === $_aclInfo) {
-			$_aclInfo = [];
+		static $_aclInfo = []; // [ fieldName => [ id => {idZasob}, perms => 'RWX...' ] // TODO: , sort_prio => {SORT_PRIO}, label => {CELL_LABEL}  ]
+		if (!array_key_exists($this->getID(), $_aclInfo)) {
+			$_aclInfo[ $this->getID() ] = [];
 			$fieldsConfig = User::getAcl()->getPermsForTable($this->getID()); // @returns [ permInfo group by ID_CELL ]; permInfo = [ ID_CELL, CELL_NAME, CELL_LABEL, SORT_PRIO, PERM_R, PERM_W, PERM_... ]
 			DBG::log($fieldsConfig, 'array', "AntAclBase: User::getAcl()->getPermsForTable(".$this->getID().");");
 			// $this->initFieldsFromConfig($fieldsConfig);
 			$permCols = [ 'PERM_R', 'PERM_W', 'PERM_X', 'PERM_C', 'PERM_S', 'PERM_O', 'PERM_V', 'PERM_E' ];
 			foreach ($fieldsConfig as $row) {
 				$nameField = $row['CELL_NAME'];
-				$_aclInfo[ $nameField ] = [
+				$_aclInfo[ $this->getID() ][ $nameField ] = [
 					'idZasob' => $row['ID_CELL'],
 					'label' => $row['CELL_LABEL'],
 					'sort_prio' => $row['SORT_PRIO'],
 				];
-				foreach ($permCols as $colPerm) $_aclInfo[ $nameField ][ $colPerm ] = (int)$row[ $colPerm ];
+				foreach ($permCols as $colPerm) $_aclInfo[ $this->getID() ][ $nameField ][ $colPerm ] = (int)$row[ $colPerm ];
 			}
 		}
-		if ($fieldName && !array_key_exists($fieldName, $_aclInfo)) {
+		if ($fieldName && !array_key_exists($fieldName, $_aclInfo[ $this->getID() ])) {
 			throw new Exception("Field not exists or missing access '{$fieldName}'");
 		}
-		return ($fieldName) ? $_aclInfo[$fieldName] : $_aclInfo;
+		return ($fieldName) ? $_aclInfo[ $this->getID() ][ $fieldName ] : $_aclInfo[ $this->getID() ];
 	}
 
 	public function getFields() { // TODO: conflict return structure with TableAcl