Skip to content

Commit 4cd3db3

Browse files
feat(abilities): add datamachine/web-fetch for public pages (#3922)
* feat(abilities): add datamachine/web-fetch for public pages Closes #3917 * fix(abilities): guard wp_parse_url false in web-fetch redirect resolution --------- Co-authored-by: homeboy-ci[bot] <266378653+homeboy-ci[bot]@users.noreply.github.com>
1 parent da5215c commit 4cd3db3

5 files changed

Lines changed: 590 additions & 97 deletions

File tree

‎plugins/data-machine/inc/Abilities/PermissionHelper.php‎

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@ class PermissionHelper {
4343
'use_tools' => 'datamachine_use_tools',
4444
'view_logs' => 'datamachine_view_logs',
4545
'create_own_agent' => 'datamachine_create_own_agent',
46+
'web_fetch' => 'publish_posts',
4647
);
4748

4849
/**
@@ -179,11 +180,13 @@ public static function can_manage(): bool {
179180
* - daily_memory: reading and appending the acting agent's daily memory.
180181
* Scope comes from the execution principal; overwrite and delete stay
181182
* behind can_manage() inside DailyMemoryAbilities.
183+
* - web_fetch: reading a public web page as text maps to publish_posts,
184+
* the same author level the web_fetch chat tool already requires.
182185
*
183186
* @since 0.37.0
184187
* @var string[]
185188
*/
186-
private const IMPLIED_BY_MANAGEMENT = array( 'view_analytics', 'render_images', 'upload_media', 'daily_memory', 'search_content' );
189+
private const IMPLIED_BY_MANAGEMENT = array( 'view_analytics', 'render_images', 'upload_media', 'daily_memory', 'search_content', 'web_fetch' );
187190

188191
/**
189192
* Check whether current context can perform an action.

0 commit comments

Comments
 (0)