| 1234567891011121314151617181920212223242526272829303132333435 |
- <?php
- Lib::loadClass('Core_AclSimpleSchemaBase');
- Lib::loadClass('Schema_UserMsgsStorageAcl');
- Lib::loadClass('ParseOgcFilter');
- class Schema_UserMsgsTrashStorageAcl extends Schema_UserMsgsStorageAcl {
- function _parseSqlWhere($params = []) {
- $sqlWhereAnd = [];
- $sqlWhereAnd[] = " m.`uiTargetType` = 'default_db_table_record' ";
- $sqlUserLogin = DB::getPDO()->quote($this->login);
- $idGroupList = $this->_getUserIdGroupList();
- if (empty($idGroupList)) throw new Exception("Brak przypisanych grup do użytkownika");
- $sqlIdGroupsCsv = implode(",", $idGroupList);
- $sqlWhereAnd[] = "
- (
- m.`A_RECORD_CREATE_AUTHOR` = {$sqlUserLogin}
- or ( m.`userTargetType` in('everyone')
- or ( m.`userTargetType`='user' and m.`userTargetName` = {$sqlUserLogin} )
- or ( m.`userTargetType`='group' and m.`userTargetName` in( {$sqlIdGroupsCsv} ) )
- )
- )
- ";
- $sqlWhereAnd[] = " m.`A_STATUS` in('OFF_HARD', 'DELETED') ";
- // TODO: parse where/ogc, etc.
- return implode(" and ", $sqlWhereAnd);
- }
- }
|