Hello,

I've tried making a custom Ægir module to do a couple of maintenance tasks on my sites. Problem is my tasks defined in hook_hosting_tasks() do not show up on the site/platform nodes.

I've identified the problem to hosting_task_fetch_tasks(). Problem is the function does not respect a task's custom access callbacks when deciding what tasks are valid. It always uses hosting_task_menu_access() which is very restrictive and sorts away anything not defined by Ægir.

The supplied patch solves this by inspecting the task to see if a custom access callback is provided, if that's the case that one is used, otherwise we fall back to hosting_task_menu_access().

I'd like someone, with a bit more insight into the machinery, could review the patch and verify that this doesn't break anything. This is how I specify my custom task. With the patch applied it shows up when viewing a platform node, https://github.com/simme/aegir-sites_switch_domain/blob/master/sites_swi.... However I don't have the means to do extensive testing on this one! :)

Cheers

CommentFileSizeAuthor
hosting_task.patch891 bytesSimmeLj

Comments

anarcat’s picture

Issue tags: +aegir-1.0

seems like a valid API concern, marking for 1.0.

anarcat’s picture

Status: Needs review » Fixed

Committed, thanks.

Status: Fixed » Closed (fixed)
Issue tags: -module, -aegir-1.0, -custom, -tasks

Automatically closed -- issue fixed for 2 weeks with no activity.

  • Commit 506c501 on 6.x-2.x, 7.x-3.x, dev-ssl-ip-allocation-refactor, dev-sni, dev-helmo-3.x by anarcat:
    #967528 - fix access control for tasks so that custom modules can define...

  • Commit 506c501 on 6.x-2.x, 7.x-3.x, dev-ssl-ip-allocation-refactor, dev-sni, dev-helmo-3.x by anarcat:
    #967528 - fix access control for tasks so that custom modules can define...