Compare commits
11 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
a3346b8958 | ||
|
|
9586405290 | ||
|
|
15d7098c46 | ||
|
|
54b62fe7f3 | ||
|
|
7355bdd27f | ||
|
|
7e9f94233a | ||
|
|
c061cba5cd | ||
|
|
c4c905042f | ||
|
|
6dee849ed9 | ||
|
|
3ff9248852 | ||
|
|
aeb691752c |
2
.github/workflows/cypress.yml
vendored
2
.github/workflows/cypress.yml
vendored
@@ -19,7 +19,7 @@ jobs:
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
node-version: [14.x]
|
||||
node-version: [16.x]
|
||||
# containers: [1, 2, 3]
|
||||
php-versions: [ '7.4' ]
|
||||
databases: [ 'sqlite' ]
|
||||
|
||||
@@ -1,6 +1,12 @@
|
||||
# Changelog
|
||||
All notable changes to this project will be documented in this file.
|
||||
|
||||
## 1.8.8
|
||||
|
||||
### Fixed
|
||||
|
||||
- fix: Pass user id along to properly check permissions in background jobs @backportbot[bot] [#5595](https://github.com/nextcloud/deck/pull/5595)
|
||||
|
||||
## 1.8.7
|
||||
|
||||
### Fixed
|
||||
|
||||
@@ -16,7 +16,7 @@
|
||||
- 🚀 Get your project organized
|
||||
|
||||
</description>
|
||||
<version>1.8.7</version>
|
||||
<version>1.8.8</version>
|
||||
<licence>agpl</licence>
|
||||
<author>Julius Härtl</author>
|
||||
<namespace>Deck</namespace>
|
||||
|
||||
@@ -210,4 +210,12 @@ class ConfigService {
|
||||
|
||||
return $this->config->getUserValue($userId ?? $this->getUserId(), 'deck', 'attachment_folder', '/Deck');
|
||||
}
|
||||
|
||||
public function setAttachmentFolder(?string $userId = null, string $path): void {
|
||||
if ($userId === null && $this->getUserId() === null) {
|
||||
throw new NoPermissionException('Must be logged in get the attachment folder');
|
||||
}
|
||||
|
||||
$this->config->setUserValue($userId ?? $this->getUserId(), 'deck', 'attachment_folder', $path);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -31,6 +31,7 @@ use OCA\Deck\Sharing\DeckShareProvider;
|
||||
use OCA\Deck\StatusException;
|
||||
use OCP\AppFramework\Http\StreamResponse;
|
||||
use OCP\Constants;
|
||||
use OCP\Files\Folder;
|
||||
use OCP\Files\IMimeTypeDetector;
|
||||
use OCP\Files\IRootFolder;
|
||||
use OCP\Files\NotFoundException;
|
||||
@@ -190,6 +191,16 @@ class FilesAppService implements IAttachmentService, ICustomAttachmentService {
|
||||
$folder = $userFolder->newFolder($this->configService->getAttachmentFolder());
|
||||
}
|
||||
|
||||
if ($folder->isShared()) {
|
||||
$folderName = $userFolder->getNonExistingName($this->configService->getAttachmentFolder());
|
||||
$folder = $userFolder->newFolder($folderName);
|
||||
$this->configService->setAttachmentFolder($this->userId, $folderName);
|
||||
}
|
||||
|
||||
if (!$folder instanceof Folder || $folder->isShared()) {
|
||||
throw new NotFoundException('No target folder found');
|
||||
}
|
||||
|
||||
$fileName = $folder->getNonExistingName($fileName);
|
||||
$target = $folder->newFile($fileName);
|
||||
$content = fopen($file['tmp_name'], 'rb');
|
||||
|
||||
@@ -103,21 +103,23 @@ class PermissionService {
|
||||
$userId = $this->userId;
|
||||
}
|
||||
|
||||
if ($cached = $this->permissionCache->get($boardId)) {
|
||||
$cacheKey = $boardId . '-' . $userId;
|
||||
if ($cached = $this->permissionCache->get($cacheKey)) {
|
||||
return $cached;
|
||||
}
|
||||
|
||||
|
||||
$board = $this->getBoard($boardId);
|
||||
$owner = $this->userIsBoardOwner($boardId, $userId);
|
||||
$acls = $board->getDeletedAt() === 0 ? $this->aclMapper->findAll($boardId) : [];
|
||||
$permissions = [
|
||||
Acl::PERMISSION_READ => $owner || $this->userCan($acls, Acl::PERMISSION_READ),
|
||||
Acl::PERMISSION_EDIT => $owner || $this->userCan($acls, Acl::PERMISSION_EDIT),
|
||||
Acl::PERMISSION_MANAGE => $owner || $this->userCan($acls, Acl::PERMISSION_MANAGE),
|
||||
Acl::PERMISSION_SHARE => ($owner || $this->userCan($acls, Acl::PERMISSION_SHARE))
|
||||
&& (!$this->shareManager->sharingDisabledForUser($this->userId))
|
||||
Acl::PERMISSION_READ => $owner || $this->userCan($acls, Acl::PERMISSION_READ, $userId),
|
||||
Acl::PERMISSION_EDIT => $owner || $this->userCan($acls, Acl::PERMISSION_EDIT, $userId),
|
||||
Acl::PERMISSION_MANAGE => $owner || $this->userCan($acls, Acl::PERMISSION_MANAGE, $userId),
|
||||
Acl::PERMISSION_SHARE => ($owner || $this->userCan($acls, Acl::PERMISSION_SHARE, $userId))
|
||||
&& (!$this->shareManager->sharingDisabledForUser($userId))
|
||||
];
|
||||
$this->permissionCache->set((string)$boardId, $permissions);
|
||||
$this->permissionCache->set($cacheKey, $permissions);
|
||||
return $permissions;
|
||||
}
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"name": "deck",
|
||||
"description": "",
|
||||
"version": "1.8.7",
|
||||
"version": "1.8.8",
|
||||
"authors": [
|
||||
{
|
||||
"name": "Julius Härtl",
|
||||
|
||||
@@ -84,7 +84,20 @@ export default {
|
||||
params.append('object_id', '' + this.objectId)
|
||||
params.append('limit', ACTIVITY_FETCH_LIMIT)
|
||||
|
||||
const response = await axios.get(generateOcsUrl(`apps/activity/api/v2/activity/${this.filter}`) + '?' + params)
|
||||
const response = await axios.get(
|
||||
generateOcsUrl(`apps/activity/api/v2/activity/${this.filter}`) + '?' + params,
|
||||
{
|
||||
validateStatus: (status) => {
|
||||
return (status >= 200 && status < 300) || status === 304
|
||||
},
|
||||
},
|
||||
)
|
||||
|
||||
if (response.status === 304) {
|
||||
this.endReached = true
|
||||
return []
|
||||
}
|
||||
|
||||
let activities = response.data.ocs.data
|
||||
if (this.filter === 'deck') {
|
||||
// We need to manually filter activities here, since currently we use two different types and there is no way
|
||||
@@ -95,7 +108,7 @@ export default {
|
||||
})
|
||||
}
|
||||
this.activities.push(...activities)
|
||||
if (response.data.ocs.meta.statuscode === 304 || activities.length === 0) {
|
||||
if (activities.length === 0) {
|
||||
this.endReached = true
|
||||
return []
|
||||
}
|
||||
|
||||
@@ -1 +1 @@
|
||||
68024
|
||||
79470
|
||||
|
||||
Reference in New Issue
Block a user