Skip to content

Commit

Permalink
seperated media mime types for sharing permissions
Browse files Browse the repository at this point in the history
  • Loading branch information
psawalka committed Jan 24, 2025
1 parent 7654b64 commit f3c529c
Show file tree
Hide file tree
Showing 3 changed files with 32 additions and 2 deletions.
3 changes: 2 additions & 1 deletion src/mixins/SharesMixin.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ import {
BUNDLED_PERMISSIONS,
} from '../lib/SharePermissionsToolBox.js'
import { COLLABORA_MIME_TYPES } from '../utils/CollaboraMimeTypes.js'
import { MEDIA_MIME_TYPES } from '../utils/MediaMimeTypes.js'

export default {
mixins: [SharesRequests, ShareTypes],
Expand Down Expand Up @@ -147,7 +148,7 @@ export default {
},
isPermissionEditAllowed() {
if (this.fileInfo.type === 'dir') return true
return !this.isPublicShare || COLLABORA_MIME_TYPES.includes(this.fileInfo.mimetype)
return !this.isPublicShare || COLLABORA_MIME_TYPES.includes(this.fileInfo.mimetype) || MEDIA_MIME_TYPES.includes(this.fileInfo.mimetype)
},
},

Expand Down
1 change: 0 additions & 1 deletion src/utils/CollaboraMimeTypes.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,5 +16,4 @@ export const COLLABORA_MIME_TYPES = [
'application/vnd.visio',
'text/plain',
'text/markdown',
'image/png',
]
30 changes: 30 additions & 0 deletions src/utils/MediaMimeTypes.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
export const MEDIA_MIME_TYPES = [
'image/jpeg',

Check failure on line 2 in src/utils/MediaMimeTypes.js

View workflow job for this annotation

GitHub Actions / eslint

Expected indentation of 1 tab but found 4 spaces
'image/png',

Check failure on line 3 in src/utils/MediaMimeTypes.js

View workflow job for this annotation

GitHub Actions / eslint

Expected indentation of 1 tab but found 4 spaces
'image/gif',

Check failure on line 4 in src/utils/MediaMimeTypes.js

View workflow job for this annotation

GitHub Actions / eslint

Expected indentation of 1 tab but found 4 spaces
'image/bmp',

Check failure on line 5 in src/utils/MediaMimeTypes.js

View workflow job for this annotation

GitHub Actions / eslint

Expected indentation of 1 tab but found 4 spaces
'image/tiff',

Check failure on line 6 in src/utils/MediaMimeTypes.js

View workflow job for this annotation

GitHub Actions / eslint

Expected indentation of 1 tab but found 4 spaces
'image/x-icon',

Check failure on line 7 in src/utils/MediaMimeTypes.js

View workflow job for this annotation

GitHub Actions / eslint

Expected indentation of 1 tab but found 4 spaces
'image/svg+xml',

Check failure on line 8 in src/utils/MediaMimeTypes.js

View workflow job for this annotation

GitHub Actions / eslint

Expected indentation of 1 tab but found 4 spaces
'video/3gpp',

Check failure on line 9 in src/utils/MediaMimeTypes.js

View workflow job for this annotation

GitHub Actions / eslint

Expected indentation of 1 tab but found 4 spaces
'video/x-msvideo',

Check failure on line 10 in src/utils/MediaMimeTypes.js

View workflow job for this annotation

GitHub Actions / eslint

Expected indentation of 1 tab but found 4 spaces
'video/dv',

Check failure on line 11 in src/utils/MediaMimeTypes.js

View workflow job for this annotation

GitHub Actions / eslint

Expected indentation of 1 tab but found 4 spaces
'video/x-flv',
'video/mp2t',
'video/mp4',
'video/quicktime',
'video/MP2T',
'video/mpeg',
'video/ogg',
'video/webm',
'image/webp',
'video/dvd',
'audio/flac',
'audio/mpegurl',
'audio/mp4',
'audio/m4b',
'audio/mpeg',
'audio/ogg',
'audio/wav',
'audio/x-scpls',
]

0 comments on commit f3c529c

Please sign in to comment.