- First commit to issue fork.
- 🇮🇳India mohit_aghera Rajkot
Add a constant (possibly to FileDownloadController?) Might be named something like FILE_DOWNLOAD_DENY or (if on the download controller) DENY.
I've added the constant for the controller.
I initially though of using the Enum for this one, however since it was just one case, I didn't thought of using this.
Discuss whether the NULL "ignore" return value also merits its own constant.
I feel we don't need this one.
I did a quick check in coregrep -rn --include="*.php" -E "const\s+\w+\s*=" core/
and didn't found any such instance.
Probably we've avoided in past?
Happy to do that if we want to go that route.Refactor to use some generic access result mechanism. There might be limitations on what we can do in a minor, even with an upgrade path, but it is worth looking into.
@xjm I'm slightly unclear about this one.
Can you please provide more information. - 🇦🇺Australia mstrelan
I was thinking about this earlier and the parallels to AccessResultInterface. The equivalent here would be AccessResultForbidden for -1, Neutral for NULL and Allowed for the array return. Having a similar interface would properly restrict what can be returned from this hook. The awkward part is that this hook does two separate things, as per its documentation:
Control access to private file downloads and specify HTTP headers
.
- 🇮🇳India mohit_aghera Rajkot
I was thinking about this earlier and the parallels to AccessResultInterface. The equivalent here would be AccessResultForbidden for -1, Neutral for NULL and Allowed for the array return. Having a similar interface would properly restrict what can be returned from this hook.
This totally makes sense to me. I can refactor this one.