The MM Media module is a submodule of Monster Menus which provides several useful features:

  • Integrates the media module with Monster Menus
  • Provides access control for media assets (image, video, audio file, etc.)
  • Provides an interface to search for media assets within the MM page tree
  • Enhances the Media Field field widget
  • Provides a WYSIWYG editor tool so that images and other assets can be chosen directly from the MM tree
  • Includes a built-in image Gallery content type

A Note about Access Control

As of version 7.x-1.25, this module takes control over access to all types of media asset. This includes media which is:

  • Referred to within a file field in a content type
  • Referred to within a text field, such as an image tag created using a WYSIWYG editor
  • Uploaded as an attachment to a node

Generally speaking, access is granted on an "or" basis. If a single media asset is referenced in more than one way, a given user will have access to it if he or she has access to it in any of the ways it is used.

For example, let's say there are two Story nodes. Story 1 is readable only to logged-in users and contains an image as an attachment. Story 2 is world-readable and refers to this same image within the Body field, by way of an <img> tag. In this case, the image becomes world-readable because the reference from Story 2 takes precedence.

If it worked the other way around it would lead to too much confusion. Let's say the initial use of the image was on the world-readable Story 2 and the second reference is added to Story 1. If the logic described above were reversed, this would cause the image on Story 2 to suddenly become inaccessible to users who are not logged-in.

Now, here's another thing to consider. Returning to the example above, what happens if we move the protected page Story 1 to the recycle bin? The image is still visible. What happens when the recycle bin is emptied? The image is still visible because it isn't actually deleted, merely one of the two nodes that refer to it has been deleted. It's only when the number of things that refer to a media item has reached zero that it is truly deleted.

If your head isn't spinning yet, don't worry, there's more. There's one big flaw in the current system, and it has to do with revisions. This only applies to content types for which the revisions feature is enabled, or when the person editing the node clicks the Revision checkbox:

Going back to the previous example, with Story 1 containing an image and an Story 2 that refers to it, let's say we edit Story 2 and remove the image from the body. The way Drupal currently works, the count of references isn't decremented in this case because the first revision of Story 2 still refers to the image. Assuming you don't ever delete old revisions, the count will only go down if Story 2 is permanently deleted. So as long as Story 2 is world-readable, the image will be, too.