Why can't a user delete their own file in their own directory?

The Basics

  • Nextcloud Server version: 31.0.6
  • Operating system and version: Debian 12
  • Web server and version: Apache 2.4.62
  • Reverse proxy and version: Nginx 1.22.1
  • PHP version: 8.2.28
  • Is this the first time you’ve seen this error? Yes
  • When did this problem seem to first start? Now
  • Installation method: not sure, what that means
  • Are you using CloudfIare, mod_security, or similar? No

Summary of the issue you are facing:

A user copied a directory from elsewhere (other user/other group), via web UI.
Now they have their own directory with some files in it, which they also own.
But they can’t delete a file in that directory, i.e. the option to delete or move exists only on the entire directoy, not a file. Again, in the web UI.
Why?

Thank you!

:thinking:

assuming the directory permissions from group A are preventing file deletion…
can the user move that file out of the copied (group A) directory and then delete it?
that would imply, that the user has no permissions to delete files in (group A) directory, because that user is not member of (group A).

1 Like

The user can neither delete nor move a single file from that directory.
I also assume, that the user just does not have the permission, but I don’t understand why and how to solve it.
After all, the user copied the files and the directory and owns it. So they should have all permissions on it, right?
But if not, how would they get the right permissions?

Btw.: The user can create a new file in that directory and can also delete it.
But not the existing files.
Anyone has an idea, what might be wrong, how to debug or even fix that?

The original directory and files is owned by ownadmin.
By impersonating ownadmin I could verify, that even that user has no option to delete a file from its own directory.

If we grant deletion permission upon ther shared folder and the user copy the file to his personal folder, he’ll be able to delete it. So the “prevent erasing” permission from the shared folder it’s being copied to the new file located in the user personal folder :frowning:
I think it’s a bug to fix :thinking:

Hi people! I have the same problem (with brand new NC32). The user copied a file from a shared folder to his personal folder. Now he can’t delete it. The contextual file menu doesn’t show the “erase file” option :hushed_face:

Create a bug report on Github, if there is none.

1 Like