Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.Sign up
(dev/core#1104) make admin panels hookable #14734
Documentation issue (& jenkins approval aside) I'm comfortable with adding this hook after seeing the patch - it's not being added in the middle of a complex function but rather at the end as a final change to 'tinker' so it's not locking us into maintaining toxic code around it. It also feels very similar to some or our other patterns around editing available blocks on a page.
So in principle I think this makes sense - once docs & jenkins are addressed
I'm also relaxed about this not having a test as it is very 'close to the surface'
@yashodha Looking at the code it looks like that admin page is retrieving links from the admin menu but bypassing permission checks? Would it be better to change the way the menu links are retrieved so that only the ones which a role has permission for are displayed?
I think this hook is OK- it seems like the sort of place in the code where we have a clear expectation of what the hook will do - ie it will just alter an array & once @yashodha documents it the implications of that array will be clear & documented.
Where I think new hooks are bad is when they are added into toxic code & the hook implementer could tweak any one of a number of things with the expectation the core code won't change in a way that will break their hook.
@yashodha I'm merging this because you said you WOULD document it - I'll leave it to you to make good on that