Skip to content
This repository has been archived by the owner on Sep 29, 2024. It is now read-only.

Commit

Permalink
Added secure file media type and config files
Browse files Browse the repository at this point in the history
  • Loading branch information
yeniatencio committed Sep 9, 2024
1 parent 3feaf0f commit 79da431
Show file tree
Hide file tree
Showing 11 changed files with 231 additions and 0 deletions.
1 change: 1 addition & 0 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
"drupal/embed": "^1.6",
"drupal/focal_point": "^2.0",
"drupal/inline_entity_form": "^1.0@RC",
"drupal/private_files_download_permission": "^3.1",
"drupal/svg_image": "^3.0",
"drupal/video_embed_field": "2.5",
"drupal/entity_usage": "^2.0@beta"
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
langcode: en
status: true
dependencies:
config:
- field.field.media.secure_file.field_secure_file
- media.type.secure_file
module:
- file
- path
id: media.secure_file.default
targetEntityType: media
bundle: secure_file
mode: default
content:
created:
type: datetime_timestamp
weight: 10
region: content
settings: { }
third_party_settings: { }
field_secure_file:
type: file_generic
weight: 0
region: content
settings:
progress_indicator: throbber
third_party_settings: { }
name:
type: string_textfield
weight: -5
region: content
settings:
size: 60
placeholder: ''
third_party_settings: { }
path:
type: path
weight: 30
region: content
settings: { }
third_party_settings: { }
status:
type: boolean_checkbox
weight: 100
region: content
settings:
display_label: true
third_party_settings: { }
uid:
type: entity_reference_autocomplete
weight: 5
region: content
settings:
match_operator: CONTAINS
match_limit: 10
size: 60
placeholder: ''
third_party_settings: { }
hidden: { }
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
langcode: en
status: true
dependencies:
config:
- field.field.media.secure_file.field_secure_file
- media.type.secure_file
module:
- file
id: media.secure_file.default
targetEntityType: media
bundle: secure_file
mode: default
content:
field_secure_file:
type: file_default
label: visually_hidden
settings:
use_description_as_link_text: true
third_party_settings: { }
weight: 0
region: content
hidden:
created: true
name: true
thumbnail: true
uid: true
26 changes: 26 additions & 0 deletions config/install/field.field.media.secure_file.field_secure_file.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
langcode: en
status: true
dependencies:
config:
- field.storage.media.field_secure_file
- media.type.secure_file
module:
- file
id: media.secure_file.field_secure_file
field_name: field_secure_file
entity_type: media
bundle: secure_file
label: File
description: ''
required: true
translatable: true
default_value: { }
default_value_callback: ''
settings:
handler: 'default:file'
handler_settings: { }
file_directory: 'secure/[date:custom:Y]-[date:custom:m]'
file_extensions: 'xls xlsx csv xlsm doc docx dotx pdf ppt pptx'
max_filesize: ''
description_field: true
field_type: file
26 changes: 26 additions & 0 deletions config/install/field.storage.media.field_secure_file.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
langcode: en
status: true
dependencies:
module:
- field_permissions
- file
- media
third_party_settings:
field_permissions:
permission_type: custom
id: media.field_secure_file
field_name: field_secure_file
entity_type: media
type: file
settings:
target_type: file
display_field: false
display_default: false
uri_scheme: private
module: file
locked: false
cardinality: 1
translatable: true
indexes: { }
persist_with_no_fields: false
custom_storage: false
12 changes: 12 additions & 0 deletions config/install/media.type.secure_file.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
langcode: en
status: true
dependencies: { }
id: secure_file
label: 'Secure File'
description: ''
source: file
queue_thumbnail_downloads: false
new_revision: false
source_configuration:
source_field: field_secure_file
field_map: { }
19 changes: 19 additions & 0 deletions config/install/pfdp.pfdp_directory.secure.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
langcode: en
status: true
dependencies: { }
id: secure
path: /secure
bypass: false
grant_file_owners: false
users: { }
roles:
dtf_secure_file_user: dtf_secure_file_user
anonymous: '0'
authenticated: '0'
administrator: '0'
approver: '0'
site_admin: '0'
editor: '0'
previewer: '0'
contributor: '0'
site_auditor: '0'
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
langcode: en
status: true
dependencies:
config:
- user.role.dtf_secure_file_user
module:
- user
id: user_add_role_action.dtf_secure_file_user
label: 'Add the DTF Secure File User role to the selected user(s)'
type: user
plugin: user_add_role_action
configuration:
rid: dtf_secure_file_user
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
langcode: en
status: true
dependencies:
config:
- user.role.dtf_secure_file_user
module:
- user
id: user_remove_role_action.dtf_secure_file_user
label: 'Remove the DTF Secure File User role from the selected user(s)'
type: user
plugin: user_remove_role_action
configuration:
rid: dtf_secure_file_user
26 changes: 26 additions & 0 deletions config/install/user.role.dtf_secure_file_user.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
langcode: en
status: true
dependencies:
config:
- media.type.secure_file
module:
- field_permissions
- media
id: dtf_secure_file_user
label: 'DTF Secure File User'
weight: 102
is_admin: null
permissions:
- 'create field_secure_file'
- 'create secure_file media'
- 'delete any secure_file media'
- 'delete any secure_file media revisions'
- 'delete own secure_file media'
- 'edit any secure_file media'
- 'edit field_secure_file'
- 'edit own field_secure_file'
- 'edit own secure_file media'
- 'revert any secure_file media revisions'
- 'view any secure_file media revisions'
- 'view field_secure_file'
- 'view own field_secure_file'
10 changes: 10 additions & 0 deletions tide_media.info.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ dependencies:
- entity_browser:entity_browser_entity_form
- entity_usage:entity_usage
- focal_point:focal_point
- pfdp:pfdp
- svg_image:svg_image
- video_embed_field:video_embed_field
- video_embed_field:video_embed_media
Expand All @@ -30,6 +31,7 @@ config_devel:
- core.entity_form_display.media.embedded_video.default
- core.entity_form_display.media.file.default
- core.entity_form_display.media.image.default
- core.entity_form_display.media.secure_file.default
- core.entity_form_display.media.video.default
- core.entity_form_display.paragraph.call_to_action_image.default
- core.entity_view_display.media.audio.default
Expand All @@ -48,6 +50,7 @@ config_devel:
- core.entity_view_display.media.image.embedded
- core.entity_view_display.media.image.embedded_with_caption
- core.entity_view_display.media.image.media_browser_preview
- core.entity_view_display.media.secure_file.default
- core.entity_view_display.media.video.default
- core.entity_view_display.media.video.embedded
- core.entity_view_display.media.video.embedded_with_transcript
Expand Down Expand Up @@ -102,6 +105,7 @@ config_devel:
- field.field.media.image.field_media_department
- field.field.media.image.field_media_image
- field.field.media.image.field_media_topic
- field.field.media.secure_file.field_secure_file
- field.field.media.video.field_license_type
- field.field.media.video.field_media_link
- field.field.media.video.field_media_audience
Expand Down Expand Up @@ -132,6 +136,7 @@ config_devel:
- field.storage.media.field_media_image
- field.storage.media.field_media_length
- field.storage.media.field_media_link
- field.storage.media.field_secure_file
- field.storage.media.field_media_show_transcript
- field.storage.media.field_media_summary
- field.storage.media.field_media_topic
Expand All @@ -145,11 +150,16 @@ config_devel:
- media.type.embedded_video
- media.type.file
- media.type.image
- media.type.secure_file
- media.type.video
- paragraphs.paragraphs_type.call_to_action_image
- pfdp.pfdp_directory.secure
- taxonomy.vocabulary.license_type
- tide_media.settings
- views.view.tide_media_browser
- system.action.user_add_role_action.dtf_secure_file_user
- system.action.user_remove_role_action.dtf_secure_file_user
- user.role.dtf_secure_file_user
optional:
- jsonapi_extras.jsonapi_resource_config.paragraph--call_to_action_image
- jsonapi_extras.jsonapi_resource_config.paragraph--timeline
Expand Down

0 comments on commit 79da431

Please sign in to comment.