Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(files_sharing): allow not deleting expiring shares #48225

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

skjnldsv
Copy link
Member

@skjnldsv skjnldsv commented Sep 19, 2024

Fix #17996

Feature

Shares that expires are just deleted. Which leads to confusion.

  • We don't even know if the share existed or not....
  • With the new file request, we might want to extend the drop period time...
  • We need more transparency

Solution

  • Allow admins to disable share deletion on expiration (opt-in)
    2024-09-19_19-27
  • Adds a new view to list all expired shares
    image

Status

  • Add admin setting
  • Add api controller
  • Add new view
  • Add integration tests

@skjnldsv skjnldsv added this to the Nextcloud 31 milestone Sep 19, 2024
@skjnldsv skjnldsv self-assigned this Sep 19, 2024
/** @var IAppManager */
private $appManager;

/** @var IServerContainer */

Check notice

Code scanning / Psalm

DeprecatedInterface Note

Interface OCP\IServerContainer is marked as deprecated
IGroupManager $groupManager,
IRootFolder $rootFolder,
IAppManager $appManager,
IServerContainer $serverContainer) {

Check notice

Code scanning / Psalm

DeprecatedInterface Note

Interface OCP\IServerContainer is marked as deprecated
'id' => $share->getFullId(),
'share_type' => $share->getShareType(),
'uid_owner' => $share->getSharedBy(),
'displayname_owner' => $this->userManager->get($share->getSharedBy())->getDisplayName(),

Check notice

Code scanning / Psalm

PossiblyNullReference Note

Cannot call method getDisplayName on possibly null value
'expiration' => null,
'token' => null,
'uid_file_owner' => $share->getShareOwner(),
'displayname_file_owner' => $this->userManager->get($share->getShareOwner())->getDisplayName(),

Check notice

Code scanning / Psalm

PossiblyNullReference Note

Cannot call method getDisplayName on possibly null value
if (!$node) {
// fallback to guessing the path
$node = $userFolder->get($share->getTarget());
if ($node === null || $share->getTarget() === '') {

Check notice

Code scanning / Psalm

DocblockTypeContradiction Note

OCP\Files\Node does not contain null
*/
private function getRoomShareHelper() {
if (!$this->appManager->isEnabledForUser('spreed')) {
throw new QueryException();

Check notice

Code scanning / Psalm

DeprecatedClass Note

OCP\AppFramework\QueryException is marked deprecated
*/
private function getDeckShareHelper() {
if (!$this->appManager->isEnabledForUser('deck')) {
throw new QueryException();

Check notice

Code scanning / Psalm

DeprecatedClass Note

OCP\AppFramework\QueryException is marked deprecated
*/
private function getSciencemeshShareHelper() {
if (!$this->appManager->isEnabledForUser('sciencemesh')) {
throw new QueryException();

Check notice

Code scanning / Psalm

DeprecatedClass Note

OCP\AppFramework\QueryException is marked deprecated
* @inheritdoc
*/
public function getExpiredShares($userId, $shareType, ?string $path = null, $limit = 50, $offset = 0) {
$shares = $this->getSharesBy($userId, $shareType, $path, false, $limit, $offset);

Check failure

Code scanning / Psalm

InvalidArgument Error

Argument 3 of OC\Share20\Manager::getSharesBy expects OCP\Files\Node|null, but null|string provided
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Keep list of expired public shares
1 participant