Find better way of checking permissions that doesn't require a hook. #1

Open
opened 2026-04-20 12:26:41 +10:00 by Dreytac · 0 comments
Owner

Using a hook means permission checks fail when calling from within another hook multiple times.

Current hacky way of getting around this is:

$events = kirby()->events;
call_user_func(
	\Closure::bind(
		function () use ($events) {
			unset($events->processed["permissions.page:check"]);
		}, null, $events
	)
);
Using a hook means permission checks fail when calling from within another hook multiple times. Current hacky way of getting around this is: ```php $events = kirby()->events; call_user_func( \Closure::bind( function () use ($events) { unset($events->processed["permissions.page:check"]); }, null, $events ) ); ```
Dreytac added the Kind/Enhancement
Priority
Low
4
labels 2026-04-20 12:26:41 +10:00
Sign in to join this conversation.