You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The media_of field on Media Types needs a permission check to ensure that the user can put that media on the node they are trying to attach it to. The user's permissions need to be considered in the same way that they are on member_of field on nodes (jhu-idc/idc-isle-dc#108).
Jordan Dukart 9:54 AM
https://github.com/jhu-idc/idc_defaults/blob/main/idc_defaults.module#L10-L20, could add a condition there that looks for whatever other field
idc_defaults.module
/**
* Implements hook_entity_bundle_field_info_alter().
*/
function idc_defaults_entity_bundle_field_info_alter(&$fields, EntityTypeInterface $entity_type, $bundle) {
if (isset($fields['field_member_of'])) {
Show more
<https://github.com/jhu-idc/idc_defaults|jhu-idc/idc_defaults>jhu-idc/idc_defaults | Added by GitHub
9:54
if (isset($fields['field_media_of'])) {
$fields['field_media_of']->addConstraint('WorkbenchAccess');
}
or whatever.
Note that if we don't fix this, users will will be able to put media on any node they choose and they will not be limited to nodes they actually have access to.
The text was updated successfully, but these errors were encountered:
media_of file is in a media item and links to the repository item. Per John looks like if someone has access to edit any media items, then they have the ability to edit any media item records even to collections where they do not have permissions.
The
media_of
field on Media Types needs a permission check to ensure that the user can put that media on the node they are trying to attach it to. The user's permissions need to be considered in the same way that they are onmember_of
field on nodes (jhu-idc/idc-isle-dc#108).@jordandukart notes that we can add a condition to the check that's happening in the https://github.com/jhu-idc/idc_defaults/blob/main/idc_defaults.module#L10-L20.
His notes:
Note that if we don't fix this, users will will be able to put media on any node they choose and they will not be limited to nodes they actually have access to.
The text was updated successfully, but these errors were encountered: