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
{{ message }}
Repository navigation
Image Prompt Generation: Permission error for a post says "generate excerpts"Β #1233
When a user runs the ai/image-prompt-generation ability for a post they cannot edit, the error says they cannot generate excerpts:
You do not have permission to generate excerpts for this post.
The message was copied from Excerpt Generation. The same method in Generate_Image_Prompt.php already says "You do not have permission to generate image prompts." for the check without a post, so only the post check has the wrong wording.
I expect: "You do not have permission to generate image prompts for this post."
Step-by-step reproduction instructions
Enable the Image Generation feature under Settings > AI.
Log in as a Contributor.
Run the ability for a post written by another user, for example post 1 by the admin:
POST /wp-json/wp-abilities/v1/abilities/ai/image-prompt-generation/run
{"input":{"content":"A cat","context":"1"}}
Expected: 403 insufficient_capabilities with "You do not have permission to generate image prompts for this post."
Actual: 403 insufficient_capabilities with "You do not have permission to generate excerpts for this post."
Screenshots, screen recording, code snippet
Response, sent from the Contributor's session in Chrome:
HTTP 403
{"code":"insufficient_capabilities","message":"You do not have permission to generate excerpts for this post.","data":{"status":403}}
The line is includes/Abilities/Image/Generate_Image_Prompt.php:170.
Activity