|
|
@@ -44,7 +44,7 @@ class TableAcl {
|
|
|
public function setName($name) {
|
|
|
$this->_name = $name;
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
public function setNameByTableId($tableID) {
|
|
|
//used for init without knowing table name
|
|
|
$db = DB::getDB();
|
|
|
@@ -231,7 +231,7 @@ class TableAcl {
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
- *
|
|
|
+ *
|
|
|
*/
|
|
|
public function canWriteRecord($record) {
|
|
|
|
|
|
@@ -369,6 +369,9 @@ class TableAcl {
|
|
|
|
|
|
$item = array();
|
|
|
$item['htmlType'] = '';
|
|
|
+ $item['value'] = $fValue;
|
|
|
+ $item['canRead'] = $this->isAllowed($fieldID, 'R', $record);
|
|
|
+ $item['canWrite'] = $this->isAllowed($fieldID, 'W', $record);
|
|
|
$item['rawColType'] = $colType;
|
|
|
return $item;
|
|
|
|
|
|
@@ -389,7 +392,7 @@ class TableAcl {
|
|
|
}
|
|
|
$maxGrid = V::get('maxGrid', 10, $params);
|
|
|
|
|
|
- if (substr($colType['type'], 0, 3) == 'int'
|
|
|
+ if (substr($colType['type'], 0, 3) == 'int'
|
|
|
|| substr($colType['type'], 0, 7) == 'tinyint'
|
|
|
|| substr($colType['type'], 0, 8) == 'smallint'
|
|
|
|| substr($colType['type'], 0, 6) == 'bigint'
|
|
|
@@ -636,7 +639,7 @@ class TableAcl {
|
|
|
}
|
|
|
$maxGrid = V::get('maxGrid', 10, $params);
|
|
|
|
|
|
- if (substr($colType['type'], 0, 3) == 'int'
|
|
|
+ if (substr($colType['type'], 0, 3) == 'int'
|
|
|
|| substr($colType['type'], 0, 7) == 'tinyint'
|
|
|
|| substr($colType['type'], 0, 8) == 'smallint'
|
|
|
|| substr($colType['type'], 0, 6) == 'bigint'
|
|
|
@@ -836,7 +839,7 @@ class TableAcl {
|
|
|
|
|
|
/**
|
|
|
* List table ids by database
|
|
|
- *
|
|
|
+ *
|
|
|
*
|
|
|
*/
|
|
|
public static function GetTablesByDbId($db) {
|
|
|
@@ -848,20 +851,20 @@ class TableAcl {
|
|
|
foreach($_SESSION['TableAcl_cache'] as $tableID=>$obj) {
|
|
|
//if($obj->db==$db)
|
|
|
$return[$obj['name']]=$tableID;
|
|
|
-
|
|
|
+
|
|
|
}
|
|
|
return $return;
|
|
|
}
|
|
|
return null;
|
|
|
}
|
|
|
|
|
|
-
|
|
|
+
|
|
|
|
|
|
|
|
|
/**
|
|
|
* Get column object. Not initialize
|
|
|
* @returns object - column instance if exists else null
|
|
|
- *
|
|
|
+ *
|
|
|
* static
|
|
|
*/
|
|
|
public static function getInstance($idTable) {
|