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

Add sharePermissions webdav property #22834

Merged
merged 3 commits into from
Mar 31, 2016

Conversation

rullzer
Copy link
Contributor

@rullzer rullzer commented Mar 3, 2016

This property can be queries by the clients so they know the max
permissions they can use to share a file with. This will improve the UX.

The oc:permissions proptery is not enough since mountpoints have
different permissions (delete + move by default).

By making it a new property the clients can just request it. On older
servers it will just return a 404 for that property (and thus they know
they have to fall back to their hacky work arounds). But if the property
is returned the client can show proper info.

  • Added unit tests

CC: @PVince81 @DeepDiver1975 @nickvergessen @MorrisJobke @LukasReschke @schiesbn

@rullzer rullzer added this to the 9.1-next milestone Mar 3, 2016
@mention-bot
Copy link

By analyzing the blame information on this pull request, we identified @PVince81, @DeepDiver1975 and @icewind1991 to be potential reviewers

@rullzer
Copy link
Contributor Author

rullzer commented Mar 4, 2016

Or course we could also just use the CRUDS permission letters

@schiessle
Copy link
Contributor

I can't see a reshare permission, but maybe I miss something.

return '';
}

$p .= 'R';
Copy link
Contributor Author

Choose a reason for hiding this comment

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

@schiesbn reshare permission is right there... basically we return an empty string if we do not have reshare permissions... because if you don't have share permissions you also can't share RW etc.

@PVince81
Copy link
Contributor

PVince81 commented Mar 9, 2016

Makes sense, but I wonder if we should just return the permission as integer instead of using these archaic letters. Once again I forgot why we got those in the first place...

@rullzer
Copy link
Contributor Author

rullzer commented Mar 9, 2016

@PVince81 well that is fine with me of course. I just reused the letters. But we can use CRUDS letters. Or just the permissions.

Permissions might even be cleaner. Let me change the PR.

@PVince81
Copy link
Contributor

PVince81 commented Mar 9, 2016

The problem with the letters is that you need weird magic to convert them back into the integer.
So not 100% sure...

@rullzer rullzer force-pushed the webdav_property_for_share_permissions branch from 53d1a56 to e80337f Compare March 9, 2016 13:47
@rullzer
Copy link
Contributor Author

rullzer commented Mar 9, 2016

@PVince81 see e80337f

IMO that looks better indeed.

@rullzer
Copy link
Contributor Author

rullzer commented Mar 9, 2016

@owncloud/desktop-developers @owncloud/android-developers @owncloud/ios-developers

This PR will add a property oc:sharePermissions to webdav. This will provide the max permissions you can share this file with for better sharing UX. Right now it is an integer (see https://github.com/owncloud/core/blob/master/lib/public/constants.php#L64-L69). Which is identical to the permissions you send to the sharing API.

The oc:permissions field translates this integer into a string. But I think an integer makes more sense here.

Any objections to that?

@rullzer
Copy link
Contributor Author

rullzer commented Mar 10, 2016

Ok lets go with the integer then. Rebased and squashed.

@rullzer
Copy link
Contributor Author

rullzer commented Mar 10, 2016

Please review: @PVince81 @DeepDiver1975 @schiesbn

@rullzer
Copy link
Contributor Author

rullzer commented Mar 10, 2016

@DeepDiver1975 @karlitschek I think backporthing this makes sense. It will allow our clients to properly show share info for a file/folder that has been shared with them. Since our clients are doing more and more with sharing I would say this is a feature that is very welcome.

But your call.

@nickvergessen
Copy link
Contributor

Should have an integration test or something like that, to make sure the API doesnt break

@rullzer
Copy link
Contributor Author

rullzer commented Mar 10, 2016

Yes working on those :)

@karlitschek
Copy link
Contributor

makes sense. 👍 but not a critical bugfix so no backport 👎

@rullzer
Copy link
Contributor Author

rullzer commented Mar 10, 2016

Ok no backport got it :)

Anyway ready for review so I can instruct all our clients to start implenting this already ;)
Error in OCI is unrelated I think. At least I would not know how it could be affected by this..

@@ -45,6 +45,7 @@ class FilesPlugin extends \Sabre\DAV\ServerPlugin {
const FILEID_PROPERTYNAME = '{http://owncloud.org/ns}id';
const INTERNAL_FILEID_PROPERTYNAME = '{http://owncloud.org/ns}fileid';
const PERMISSIONS_PROPERTYNAME = '{http://owncloud.org/ns}permissions';
const SHARE_PERMISSIONS_PROPERTYNAME = '{http://owncloud.org/ns}sharePermissions';
Copy link
Contributor

Choose a reason for hiding this comment

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

Please make this "share-permissions"

@PVince81
Copy link
Contributor

👎 please adjust property name

This property can be queries by the clients so they know the max
permissions they can use to share a file with. This will improve the UX.

The oc:permissions proptery is not enough since mountpoints have
different permissions (delete + move by default).

By making it a new property the clients can just request it. On older
servers it will just return a 404 for that property (and thus they know
they have to fall back to their hacky work arounds). But if the property
is returned the client can show proper info.

* unit tests
* intergration test
@rullzer rullzer force-pushed the webdav_property_for_share_permissions branch from fb9eb9a to 5334bcc Compare March 31, 2016 18:31
@rullzer
Copy link
Contributor Author

rullzer commented Mar 31, 2016

Fixed the external mountpoint permissions.

@rullzer
Copy link
Contributor Author

rullzer commented Mar 31, 2016

@PVince81 property renamed.

@PVince81
Copy link
Contributor

👍

@@ -45,6 +45,7 @@ class FilesPlugin extends \Sabre\DAV\ServerPlugin {
const FILEID_PROPERTYNAME = '{http://owncloud.org/ns}id';
const INTERNAL_FILEID_PROPERTYNAME = '{http://owncloud.org/ns}fileid';
const PERMISSIONS_PROPERTYNAME = '{http://owncloud.org/ns}permissions';
const SHARE_PERMISSIONS_PROPERTYNAME = '{http://owncloud.org/ns}share-permissions';
Copy link
Contributor

Choose a reason for hiding this comment

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

btw @DeepDiver1975 always replaces configs with the real strings in his patches all the time. maybe we should have a decision whats the way to go and then all use the same way? 😉

@lock
Copy link

lock bot commented Aug 6, 2019

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@lock lock bot locked as resolved and limited conversation to collaborators Aug 6, 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.

8 participants