Check if the file isReadable() before sending a (cached) preview #1089

Merged
merged 1 commit into from Aug 30, 2016

4 participants

@nickvergessen
Nextcloud member
nickvergessen commented Aug 26, 2016 edited

This is required for the access controls, so the storage wrapper can deny the displaying and generation of previews: nextcloud/files_accesscontrol#30
Also fixes the gallery with named issue.

@icewind1991 @LukasReschke

@nickvergessen nickvergessen added this to the Nextcloud 11.0 milestone Aug 26, 2016
@icewind1991
Nextcloud member

👎 this will be a performance hit

if you want to limit permissions with a storage wrapper you'll have to modify the cache results (or just use PermissionsMask which already does everything for you)

@nickvergessen
Nextcloud member

Well then what is the use case of these methods, if they do not what they suggest they do?
Node API uses those methods, but the storage never said if it is okay?!

Infact the storage is so far never contacted. Also I would not know how I can controll the permissions in the file cache, I can't store something in there, since it depends on too many things.

@icewind1991
Nextcloud member

Infact the storage is so far never contacted

Which is exactly what it should be doing

Also I would not know how I can controll the permissions in the file cache

Use the storage wrapper to wrap the cache instance and modify the returned objects (again use the PermissionsMask wrapper)

@LukasReschke
Nextcloud member

Setting back to "to develop" until we have a consensus :)

@nickvergessen nickvergessen Check if the file isReadable() before sending a (cached) preview
f41c8c0
@icewind1991
Nextcloud member

Yes

@icewind1991
Nextcloud member

👍

@nickvergessen
Nextcloud member
@nickvergessen nickvergessen changed the title from Allow to prevent previews to Check if the file isReadable() before sending a (cached) preview Aug 30, 2016
@rullzer
Nextcloud member

👍

@rullzer rullzer merged commit 83490e9 into master Aug 30, 2016

4 checks passed

Details Scrutinizer 1 updated code elements
approvals/lgtm this commit looks good
Details continuous-integration/drone the build was successful
Details continuous-integration/travis-ci/pr The Travis CI build passed
@rullzer rullzer deleted the allow-to-prevent-previews branch Aug 30, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment