Skip to content

feat: add Team Folder recovery bin - #5062

Open
cavazquez wants to merge 2 commits into
nextcloud:masterfrom
cavazquez:split/team-folder-recovery
Open

feat: add Team Folder recovery bin#5062
cavazquez wants to merge 2 commits into
nextcloud:masterfrom
cavazquez:split/team-folder-recovery

Conversation

@cavazquez

Copy link
Copy Markdown

Assisted-by: Codex:gpt-5.6

Summary

This PR changes Team Folder deletion into a recoverable operation. Instead of permanently deleting a Team Folder immediately, it moves it to a recovery bin for 30 days.

What changed

  • Adds a recovery bin visible only to global administrators.
  • Allows global administrators to restore an archived Team Folder or permanently delete it.
  • Keeps the folder files and configuration while the folder is recoverable.
  • Permanently removes expired entries through a daily background job after 30 days.
  • Adds the database migration and updates the OpenAPI contract and generated TypeScript types.
  • Updates occ groupfolders:delete: the default operation archives the folder, while --permanent deletes its data.

Testing

  • Manually tested archive, restore, and permanent deletion in a Nextcloud 36 instance.
  • Ran PHP lint, PHP-CS-Fixer, PHPStan, and the FolderManager recovery tests: 35 tests and 81 assertions passed.
  • Ran ESLint, Stylelint, and the production frontend build.
  • The full local PHPUnit suite has one unrelated Circles test failure because the local development container does not include Circles. The repository CI installs Circles for that suite.

🤖 AI (if applicable)

  • The content of this PR was partly or fully generated using AI

Assisted-by: Codex:gpt-5.6
Signed-off-by: Cristian Vazquez <cristianvazquez4@gmail.com>
Comment thread lib/Controller/FolderController.php Outdated
Comment on lines +343 to +346
#[NoAdminRequired]
#[FrontpageRoute(verb: 'GET', url: '/folders/deleted')]
public function getDeletedFolders(): DataResponse {
$this->requireGlobalAdmin();

@JonathanTreffler JonathanTreffler Sep 1, 2026

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why use NoAdminRequired and then immediately do a manual admin check?

(I am not a maintainer of this repository and this is not a full review)

Assisted-by: Codex:gpt-5.6
Signed-off-by: Cristian Vazquez <cristianvazquez4@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants