UPDATE: see end of thsi answer for some infor on changing permissions:
I suspect you cannot prevent that delete in normal usage (without changing permissions)...
You can find a reasonable explanaion of how this works in the answer in this AskUbuntu Question .. I can continue playing a video after I Shift-Delete it.
There may be some special way to manually intervene and prevent this (by changing permissions), but in my experience ,having only recently moved to Ubuntu, I initially found this behaviour quite alarming (because it was so different to what I was used to)...
I now like this feature...it has some nice advantages once you know that it behaves like this...
UPDATE: An example of what you want is possible easily seen (and done) in the
/tmp folder... You set read and write permissions to a group, so all members of that group can read and write... However, because the
/tmp folder is owned by root (just another user)... and this other user has set the permission of the /tmp folder to 'sticky', only you (the owner) can delete files in /tmp
Here is a step by step example..
# To give a select group of users read/write/create access
# to a specific directory (and its sub-directories)
# Fil deletion is only possible by the directory's owner, or by root.
# Members of the group can create sub-directories.
# create a primary user who will own the directory.
sudo adduser pri_user
# create a group; for the exclusive use of this directory (+owner +root)
sudo groupadd pri_group
# make the primary directory
sudo mkdir /pri_dir
# set pri_dir's owner and group
sudo chown pri_user:pri_group /pri_dir
# set pri_dir's permissions; the '1' is for the sticky bit.
sudo chmod 1770 /pri_dir
# create users
sudo adduser nodel1
sudo adduser nodel2
# Add users to pri_group
sudo usermod -aG pri_group nodel1
sudo usermod -aG pri_group nodel2
# Note. For files to be accessible they must be given
# Read-and-Wrige permisson to group pri_group