2014-11-10 15:00:25 +00:00
|
|
|
<?php
|
|
|
|
/**
|
2015-02-26 10:37:37 +00:00
|
|
|
* Copyright (c) 2014 Robin Appelman <icewind@owncloud.com>
|
|
|
|
* This file is licensed under the Affero General Public License version 3 or
|
|
|
|
* later.
|
|
|
|
* See the COPYING-README file.
|
2014-11-10 15:00:25 +00:00
|
|
|
*/
|
2015-02-26 10:37:37 +00:00
|
|
|
|
2014-11-10 15:00:25 +00:00
|
|
|
namespace OC\Files\Cache\Wrapper;
|
|
|
|
|
|
|
|
class CachePermissionsMask extends CacheWrapper {
|
|
|
|
/**
|
|
|
|
* @var int
|
|
|
|
*/
|
|
|
|
protected $mask;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @param \OC\Files\Cache\Cache $cache
|
|
|
|
* @param int $mask
|
|
|
|
*/
|
|
|
|
public function __construct($cache, $mask) {
|
|
|
|
parent::__construct($cache);
|
|
|
|
$this->mask = $mask;
|
|
|
|
}
|
|
|
|
|
|
|
|
protected function formatCacheEntry($entry) {
|
|
|
|
if (isset($entry['permissions'])) {
|
|
|
|
$entry['permissions'] &= $this->mask;
|
|
|
|
}
|
|
|
|
return $entry;
|
|
|
|
}
|
|
|
|
}
|