Explorar el Código

fixed BUG in canReadField - added 'O' to allow read

Piotr Labudda hace 8 años
padre
commit
2703ed0cd5
Se han modificado 2 ficheros con 3 adiciones y 1 borrados
  1. 1 1
      SE/se-lib/AntAclBase.php
  2. 2 0
      SE/se-lib/TableAcl.php

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

@@ -170,7 +170,7 @@ class AntAclBase extends Core_AclBase {
 		try {
 			$fieldAclInfo = $this->getAclInfo($fieldName);
 			DBG::log($fieldAclInfo, 'array', "AntAclBase: canReadField({$fieldName})...");
-			return ($fieldAclInfo['PERM_R'] > 0);
+			return ($fieldAclInfo['PERM_R'] > 0 || $fieldAclInfo['PERM_V'] > 0 || $fieldAclInfo['PERM_O'] > 0);
 		} catch (Exception $e) {
 			DBG::log($e);
 			return false;

+ 2 - 0
SE/se-lib/TableAcl.php

@@ -328,6 +328,7 @@ class TableAcl extends Core_AclBase {
 	}
 	public function canReadField($fieldName) {
 		$idZasob = $this->getFieldIdByName($fieldName);
+		// DBG::log($this->_fields[$idZasob], 'array', "canReadField({$fieldName})");
 		if (!$idZasob) return false;
 		if ('ID' == $fieldName) return true;
 		if ('A_RECORD_CREATE_DATE' == $fieldName) return true;
@@ -336,6 +337,7 @@ class TableAcl extends Core_AclBase {
 		if ('A_RECORD_UPDATE_AUTHOR' == $fieldName) return true;
 		if ($this->hasFieldPerm($idZasob, $taskPerm = 'R')) return true;
 		if ($this->hasFieldPerm($idZasob, $taskPerm = 'V')) return true;
+		if ($this->hasFieldPerm($idZasob, $taskPerm = 'O')) return true; // TODO: has 'O' ? @see canReadObjectField
 		return false;
 	}
   public function canReadObjectField($fieldName, $record) {