project-novi / novi

A novel way to navigate anything
https://novi-docs.mivik.moe
1 stars 1 forks source link

Hook priority #4

Open Mivik opened 3 weeks ago

Mivik commented 3 weeks ago

We can hook functions using RegisterHook, but common things like checking permission for invoking the function should not be hooked. Current solution is to provide an extra argument to specify the permission that invoking the function requires, but that's too static and not flexible. Introducing hook priority could solve this in a way that, the part of code checking for permission cannot be hooked.

Mivik commented 3 weeks ago

This is partially resolved in 6b72129e90833c4504db0fa1a007b2107d28cb99, as we introduce the hookable parameter and separate functions into two: one for checking permission and the inner one (.impl) for doing the actual job