Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,12 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](http://keepachangelog.com/)
and this project adheres to [Semantic Versioning](http://semver.org/).

## 2.7.2 – 2026-03-16

### Fixed

- Improve testing [#392](https://github.com/nextcloud/approval/pull/392) @lukasdotcom

## 2.7.1 - 2026-01-23

### Fixed
Expand Down
2 changes: 1 addition & 1 deletion appinfo/info.xml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ Approve/reject files based on workflows defined by admins.
**Warning**: The DocuSign integration is no longer part of this app
and can be installed with [this app](https://apps.nextcloud.com/apps/integration_docusign).
]]></description>
<version>2.7.1</version>
<version>2.7.2</version>
<licence>agpl</licence>
<author>Julien Veyssier</author>
<namespace>Approval</namespace>
Expand Down
18 changes: 17 additions & 1 deletion lib/Service/UtilsService.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@
use OCP\Constants;
use OCP\Files\IRootFolder;
use OCP\Files\Node;

use OCP\IUser;
use OCP\IUserManager;
use OCP\Share\IManager as IShareManager;
Expand Down Expand Up @@ -156,6 +155,23 @@ public function groupHasAccessTo(string $userId, Node $fileNode, ?string $groupI
return false;
}

/**
* Check if user can share a given file
*
* @param int $fileId
* @param string|null $userId
* @return bool
*/
public function userCanShareFile(int $fileId, ?string $userId): bool {
$user = $this->userManager->get($userId);
if ($user instanceof IUser) {
$userFolder = $this->root->getUserFolder($userId);
$node = $userFolder->getFirstNodeById($fileId);
return $node !== null && $node->isShareable();
}
return false;
}

/**
* @param string $name of the new tag
* @return array
Expand Down
Loading