-
Notifications
You must be signed in to change notification settings - Fork 112
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
return share-types in ocs propfind responses #1329
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This change is very heavy on the server side.
Please add a config option to the dav service: include-shares-in-propfind
and set it as false by default.
These behaviour will be enabled only when this option is true.
@corby the ListShares rpc can take a path argument. Use it to get a list of all grants in a folder instead of every file individually. You can send that request in parralel to the ListContainer. When the ListContainer request has returned you can prepare a map[fileid]metadata instead of the current list. @labkode that should not be heavy. |
@butonic that is a good improvement, however that config option is needed to enable or disable it on demand. We don't use it for example. |
51d19ec
to
a8e945f
Compare
So after talking with @butonic, I rewrote it and we read the shares directly during the ListFolder call from the extended attributes. |
c8c6092
to
ebb0852
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code looks good
pkg/storage/fs/ocis/node.go
Outdated
@@ -387,6 +392,12 @@ func (n *Node) AsResourceInfo(ctx context.Context) (ri *provider.ResourceInfo, e | |||
log.Error().Err(err).Interface("node", n).Msg("could not list attributes") | |||
} | |||
|
|||
if common.FindString(mdKeys, _ShareTypesKey) != -1 { | |||
if n.hasUserShares(ctx) { | |||
ri.ArbitraryMetadata.Metadata[_ShareTypesKey] = "0" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I was confused by the "0"
and needed to ask. For the record, it would be really cool to have constants for the share types.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, I agree. 👍
ebb0852
to
d509b4e
Compare
d509b4e
to
5cefb2b
Compare
Implements owncloud/ocis#929