File tree Expand file tree Collapse file tree 1 file changed +5
-17
lines changed Expand file tree Collapse file tree 1 file changed +5
-17
lines changed Original file line number Diff line number Diff line change @@ -36,33 +36,21 @@ export function isDownloadable(node: Node): boolean {
3636 return true
3737}
3838
39-
4039/**
4140 * Check permissions on the node if it can be synced/open locally
4241 *
4342 * @param node The node to check
4443 * @return True if syncable, false otherwise
4544 */
4645export function isSyncable ( node : Node ) : boolean {
47- if ( ( node . permissions & Permission . UPDATE ) === 0 ) {
46+ if ( ! node . isDavResource ) {
4847 return false
4948 }
5049
51- // check hide-download property of shares
52- if ( node . attributes [ 'hide-download' ] === true
53- || node . attributes [ 'hide-download' ] === 'true'
54- ) {
50+ if ( ( node . permissions & Permission . UPDATE ) === 0 ) {
5551 return false
5652 }
5753
58- // If the mount type is a share, ensure it got download permissions.
59- if ( node . attributes [ 'share-attributes' ] ) {
60- const shareAttributes = JSON . parse ( node . attributes [ 'share-attributes' ] || '[]' ) as Array < ShareAttribute >
61- const downloadAttribute = shareAttributes . find ( ( { scope, key } : ShareAttribute ) => scope === 'permissions' && key === 'download' )
62- if ( downloadAttribute !== undefined ) {
63- return downloadAttribute . value === true
64- }
65- }
66-
67- return true
68- }
54+ // Syncable has the same permissions as downloadable for now
55+ return isDownloadable ( node )
56+ }
You can’t perform that action at this time.
0 commit comments