Problem/Motivation

Without the generate media with ai permission, /admin/content/media/generate answers 403, but /media/add?ai=1 typed by hand still lists AI types with ?ai_media=1 links. They fall back to upload, so nothing is exposed, but the list is misleading.

Steps to reproduce

  1. Log in as a user who can add media but lacks generate media with ai.
  2. Open /media/add?ai=1.

Proposed resolution

Filter the list only when the user has the permission.

Remaining tasks

  • ✅ File an issue
  • ❌ Addition/Change/Update/Fix
  • ❌ Testing to ensure no regression
  • ➖ Automated unit/functional testing coverage
  • ➖ Developer Documentation support
  • ➖ User Guide Documentation support
  • ➖ UX/UI designer responsibilities
  • ➖ Accessibility and Readability
  • ❌ Reviewed by a human
  • ❌ Code review by maintainers
  • ❌ Full testing and approval
  • ❌ Credit contributors
  • ❌ Review with the product owner
  • ✅ Update Release Notes
  • ✅ Release

User interface changes

  • Before (1.0.x): without the permission, the list is filtered and links to Generate mode.
     without the permission, the list is filtered and links to Generate mode.
  • After: core's Add media list with plain links.
     core's Add media list with plain links.

API changes

  • N/A

Data model changes

  • N/A

Release notes snippet

  • N/A

AI-Generated: Yes

Issue fork ai_media-3634865

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

rajab natshah created an issue. See original summary.

rajab natshah’s picture

Issue summary: View changes
StatusFileSize
new46.51 KB
new56.79 KB

  • rajab natshah committed 16a5e45d on 1.0.x
    fix: #3634865 Check the generate permission before filtering the media...
rajab natshah’s picture

Issue summary: View changes
Status: Active » Fixed
Issue tags: +ai_media-1.0.0-rc1

✅ Released ai_media-1.0.0-rc1

Now that this issue is closed, review the contribution record.

As a contributor, attribute any organization that helped you, or if you volunteered your own time.

Maintainers, credit people who helped resolve this issue.