| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657 |
- <?php
- Lib::loadClass('Core_AclBase');
- class Schema_AccessOwnerStorageAcl extends Core_AclBase {
- public function getSourceName() { return 'objects'; }
- public function init($force = false) {}
- public function isInitialized() { return true; }
- public function getName() { return 'AccessOwner'; }
- public function getRootTableName() { return 'ADMIN_USERS'; }// TODO: turn off - use getName for generating ref's
- public function getFieldListByIdZasob() { return $this->getRealFieldListByIdZasob(); }
- public function getVirtualFieldListByIdZasob() { return array(); }
- public function getRealFieldListByIdZasob($force = false) {
- $cols[100000] = 'id';// ADMIN_USERS.ID
- $cols[100001] = 'login';// ADMIN_USERS.ADM_ACCOUNT
- $cols[100002] = 'name';// ADMIN_USERS.ADM_NAME
- return $cols;
- }
- public function getFields() { return array_values($this->getRealFieldListByIdZasob()); }
- public function getFieldType($fieldName) { return null; }
- // TODO: replace legacy functions: isAllowed, hasFieldPerm, getFieldIdByName
- public function canCreateField($fieldName) { return false; }
- public function canReadField($fieldName) { return true; }
- public function canReadObjectField($fieldName, $record) {return true; }
- public function canWriteField($fieldName) { return false; }
- public function canWriteObjectField($fieldName, $record) { return false; }
- public function getItems($params = array()) {
- $DBG = V::get('DBG_DS', 0, $_GET, 'int');
- if($DBG>2){echo 'C.'.get_class($this).' L.' . __LINE__ . " getItems \$params:";print_r($params);echo "\n";}
- $items = DB::getPDO()->fetchAllByKey("
- select u.ID as id, u.ADM_ACCOUNT as login, u.ADM_NAME as name
- from ADMIN_USERS u
- where u.A_STATUS = 'NORMAL'
- and u.ADM_TECH_WORKER != 'NO'
- ", $key = 'id');
- if($DBG>2){echo 'C.'.get_class($this).' L.' . __LINE__ . " getItems \$items:";print_r($items);echo "\n";}
- return $items;
- }
- public function addItem($itemTodo) { throw new Exception("Insert not allowed"); }
- public function updateItem($itemPatch) { throw new Exception("Update not allowed"); }
- public function getGeomFieldType($fieldName) { return null; }
- public function getPrimaryKeyField() { return 'id'; }
- public function getID() { return 0; }
- public function getAttributesFromZasoby() { return array(); }
- public function isEnumerationField($fieldName) { return false; }
- public function getEnumerations($fieldName) { return null; }
- public function getXsdFieldType($fieldName) {
- if ('id' == $fieldName) return 'xsd:string';
- if ('login' == $fieldName) return 'xsd:string';
- if ('name' == $fieldName) return 'xsd:string';
- }
- public function isGeomField($fldName) { return false; }
- }
|