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 @@ -37,33 +37,21 @@ export function isDownloadable(node: Node): boolean {
3737 return true
3838}
3939
40-
4140/**
4241 * Check permissions on the node if it can be synced/open locally
4342 *
4443 * @param node The node to check
4544 * @return True if syncable, false otherwise
4645 */
4746export function isSyncable ( node : Node ) : boolean {
48- if ( ( node . permissions & Permission . UPDATE ) === 0 ) {
47+ if ( ! node . isDavResource ) {
4948 return false
5049 }
5150
52- // check hide-download property of shares
53- if ( node . attributes [ 'hide-download' ] === true
54- || node . attributes [ 'hide-download' ] === 'true'
55- ) {
51+ if ( ( node . permissions & Permission . UPDATE ) === 0 ) {
5652 return false
5753 }
5854
59- // If the mount type is a share, ensure it got download permissions.
60- if ( node . attributes [ 'share-attributes' ] ) {
61- const shareAttributes = JSON . parse ( node . attributes [ 'share-attributes' ] || '[]' ) as Array < ShareAttribute >
62- const downloadAttribute = shareAttributes . find ( ( { scope, key } : ShareAttribute ) => scope === 'permissions' && key === 'download' )
63- if ( downloadAttribute !== undefined ) {
64- return downloadAttribute . value === true
65- }
66- }
67-
68- return true
69- }
55+ // Syncable has the same permissions as downloadable for now
56+ return isDownloadable ( node )
57+ }
You can’t perform that action at this time.
0 commit comments