Skip to content

remove the "Shared" folder - #8026

Merged
schiessle merged 34 commits into
masterfrom
remove_shared_folder
Apr 24, 2014
Merged

schiessle merged 34 commits into
masterfrom
remove_shared_folder

Conversation

@schiessle

Copy link
Copy Markdown
Contributor

This is the branch I'm working on to remove the shared folder. It is not yet ready, but I thought it would be a good idea to allow interested people to have a look at the changes as early as possible. Feel free to have a look at the code and share your thoughts, ideas, code or whatever you want.

This branch is ready for review.

General stuff:

  • shares are mounted directly to the root
  • download shared file
  • edit shared file with internal text editor
  • upload to folder
  • use the right permissions if user navigates to a shared folder (at the moment a reload is needed)
  • navigate into sub-folders
  • show previews
  • rename shared item
  • move shared item (it is not allowed to move one share "mount point" into another one)
  • show shared files as files and not as folder
  • fix previews for shared files
  • check against root folder for name conflicts if a file/folder is shared
  • What happens if users start to rename a group share (fix & add unit tests)?
  • What happens if you delete a shared file/folder (file goes to both trash bin, owner and current user)
  • Use etags always from the files in the fscache, we no longer need a extra db entry for the Shared folders (should already work, but needs to be checked)
  • adapt unit test

Check other apps:

  • encryption
  • trash
  • versions
  • check webdav/sync client
  • all other places where Shared/ might be hard-coded (everything in core should work)

Migration Tasks:

  • Add upgrade script: make Shared a real folder and keep the shares there by adjusting the file_target column.

Thinks you should know:

  • It is not possible to share a folder above a share mount point.

Known Issues:

  • Gallery doesn't work yet, I will work on it in the gallery repository.
  • Activity still shows Shared/ in the path - can be fixed after merge

@schiessle

Copy link
Copy Markdown
Contributor Author

@icewind1991 At the moment I just add a mount point for every share. If I understand it correctly than users are not allowed to rename or move mount points. But this is something we want to allow for shared files/folders. Any idea how to solve it? This is probably also a problem you will face with the server-to-server sharing.

@PVince81

PVince81 commented Apr 3, 2014

Copy link
Copy Markdown
Contributor

How about linking mount points to fileid instead of full path? We'd require the mount point folder to exist (or auto create it). This way the folder can be moved around, renamed.
If we don't, it means the storage class has to manually catch all file operations on the mount point and need special handling.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

what is the purpose of the answer.txt file?
Magic strings always frighten me 😉

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I just explicitly referred a file for test purpose and forget to remove it again before preparing the pull request.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I see - thanks for clarification

@DeepDiver1975

Copy link
Copy Markdown
Contributor

It is not yet ready, but I thought it would be a good idea to allow interested people to have a look at the changes as early as possible. Feel free to have a look at the code and share your thoughts, ideas, code or whatever you want.

Nice move - Thanks!

@schiessle

Copy link
Copy Markdown
Contributor Author

This branch is already in a really usable stage. Maybe some apps needs to be adjusted but everything else should already work.

@jancborchardt Can you give it a try to check the visual representation? At the moment I use for shared folders the same icon we use for "Shared/" in ownCloud6. Shared files just show the preview. I think that's OK, or should we have some kind of overlay icon which also indicates that it is a shared file? Next to each shared file/folder we have the text "Shared by userX" the same way it is shown in OC6. So it should be fairly easy to detect the shared files also without a special (overlay) icon.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

isset missing?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

unset() doesn't care if the array index exists or not. In any case it will continue without any warning or error.

@PVince81

Copy link
Copy Markdown
Contributor

Went through the code with @schiesbn and overall it looks good.
Didn't have time to test. This needs a good regression test!

A few more points to test:

  • test with reshare + public link
  • test with reshare + public link + public upload

@PVince81

Copy link
Copy Markdown
Contributor
  • Can't renamed folder named "Shared" in root
  • Grep the whole code for "Shared", there are a few occurrences left
  • TODO: Remove "Shared" folder mount point restriction in files_external

@schiessle

Copy link
Copy Markdown
Contributor Author

This branch is ready for testing! Please try it out, play with it and review the code... Thanks!

@schiessle schiessle changed the title [WIP] remove the "Shared" folder remove the "Shared" folder Apr 14, 2014
@icewind1991

Copy link
Copy Markdown
Contributor

Tested basic sharing, moving shared files, deleting shared files and resharing.

Code looks good at a glance 👍

Comment thread apps/files_sharing/appinfo/update.php Outdated

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

That sql has a bad taste - @schiesbn would it be possible to setup a unit test for this? THX

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

It is basically to avoid to execute a update query for every share to update the file_target. I will add a unit test for it. BTW, this can probably also lead to problems if we update to many rows... I will break this down into chunks of 99 rows per query, like I did for the other one.

@DeepDiver1975

Copy link
Copy Markdown
Contributor

running litmus on a shared folder also works - @schiesbn nice job!

@DeepDiver1975

Copy link
Copy Markdown
Contributor

@schiesbn looks like I cannot move a file within a shared folder to the outside world - is that an expected behavior?

@jancborchardt

Copy link
Copy Markdown
Contributor

@DeepDiver1975 @schiesbn it’s definitely not the way it should work. :) Moving files outside of shared folder should be fully possible. Shared folders and files within shared folders should behave like normal folders.

@schiessle

Copy link
Copy Markdown
Contributor Author

This should be possible if you have delete permissions for the shared folder. Because moving the file out of the shared folder will delete it for the owner. Did you checked the permissions? I will also give it a try later.

@jancborchardt

Copy link
Copy Markdown
Contributor

@schiesbn nice! Looks good interface-wise, great! :)

I also have @DeepDiver1975’s problem though: When I have full edit permissions on a shared folder (and can remove files inside) I can still not move a file outside of the folder.

@schiessle

Copy link
Copy Markdown
Contributor Author

@DeepDiver1975 I added a unit test for the update routine and also addressed all your other comments. Maybe you want to have another look...

@schiessle

Copy link
Copy Markdown
Contributor Author

@DeepDiver1975 & @jancborchardt I also fixed the rename problem, you should now be able to move files out of a shared folder if you have the permissions.

@jancborchardt

Copy link
Copy Markdown
Contributor

Yeah, that works now. Nice! I can’t do a code review though, but interface-wise this gets a 👍

@MorrisJobke

Copy link
Copy Markdown
Contributor
  • User cannot rename a shared element (tested for folder and file) if it is shared WITHOUT modify permission

@schiessle

Copy link
Copy Markdown
Contributor Author

@MorrisJobke The user should always be able to rename a shared file or folder. This will only affect the user who renamed it. That's one of the design decisions regarding the new sharing. People should be able to organize their shares as they wish. Only renaming files within a shared folder should be blocked if the user has neither "update" nor "create"+"delete" permission because this would affect all users including the owner.

@scrutinizer-notifier

Copy link
Copy Markdown

A new inspection was created.

@icewind1991

Copy link
Copy Markdown
Contributor

Tested, code still good 👍

@ghost

ghost commented Apr 23, 2014

Copy link
Copy Markdown

@schiessle

Copy link
Copy Markdown
Contributor Author

@DeepDiver1975 @MorrisJobke @LukasReschke @bantu all your concerns are addressed, can I get a second +1? Thanks!

@MTRichards

Copy link
Copy Markdown
Contributor

Question: If a shared file exists, and this is added, that still exists, right? So there should be no migration problems. Is that correct?

@DeepDiver1975

Copy link
Copy Markdown
Contributor

@schiesbn I asked @dragotin and @danimo to have a look and do some testing with the desktop client as you have been asking as well. As they are currently busy with 1.6.0 we either wait or merge and perform further testing in master.

I'd vote for merge @karlitschek

@jancborchardt

Copy link
Copy Markdown
Contributor

I had no migration problems when testing. Could switch back and forth between current and this one without any issues.

@schiessle

Copy link
Copy Markdown
Contributor Author

@DeepDiver1975 I would also prefer to merge it now and do additional sync client tests later on master.

@MTRichards Yes. Since with the "new sharing" we no longer have a "Shared" folder we create a real "Shared" folder during upgrade and adjust the share target to point to the Shared folder for existing shares. So for users nothing will change. The share will be at exactly the same place like before after upgrade. But then they can move it out of the Shared folder, organize them as they wish and new shares will go directly to the root folder

@LukasReschke

Copy link
Copy Markdown
Contributor

👍 from my side. Good work!

@schiessle

Copy link
Copy Markdown
Contributor Author

I will merge it now, since I have a additional +1 and already discussed and agreed with @karlitschek at the beginning of the week that it would be good to merge it early.

schiessle pushed a commit that referenced this pull request Apr 24, 2014
@schiessle
schiessle merged commit f520305 into master Apr 24, 2014
@schiessle
schiessle deleted the remove_shared_folder branch April 24, 2014 16:45
@jancborchardt

Copy link
Copy Markdown
Contributor

OH MAN HIGH FIVES ALL AROUND! :) ✋ 🎉

@PVince81

Copy link
Copy Markdown
Contributor

🍸 really happy for that one.

@PVince81 PVince81 mentioned this pull request Apr 29, 2014
4 tasks done
@sgoth

sgoth commented Jul 12, 2014

Copy link
Copy Markdown

citing @schiesbn

This behavior existed in the past (OC4) and it was really confusing. A delete button should always have the same intended operation -> delete. This is even more important if it comes to webdav mounts or synced folders. Further it also creates problems with the API. The delete operation will trigger all the delete proxies and hooks. Apps listening to this hooks and proxies need to be sure that if such a signal gets triggered it is really a delete operation. Therefore it is a bad idea to internally change a delete operation to a silent un-share. It is still part of the re-design ideas for the share drop-down to add a dedicated un-share operation to it. So un-share will probably come back at some point in time but not as a abused delete operation.

On a core 7.0.0RC1 with a 1.6.1 mirall (on linux) try:
User A shares folder F to group with Users A and B (permissions don't matter);
User B gets his root "polluted" with unexpected F;
User B deletes F in local filesystem;
=> F is unshared for B, no logs, no errors neither on client nor on server

Sorry for messing with this old PR but I'm not sure if this is a bug or feature...

@PVince81

Copy link
Copy Markdown
Contributor

@SEEZER can you elaborate ? What's your issue ?
Please raise a separate ticket.

What do you mean "User B deletes F in local filesystem" ? I assume that user deleted F in the web UI.
This operation will "unshare" the file from A.
A will still have access to the folder.
At least that's how it works now on 7.0.0RC1.
A recipient cannot delete a file/folder that was shared with them any more (but they can delete what's inside the folder).

@lock lock Bot locked as resolved and limited conversation to collaborators Aug 20, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.