From af14020e42481088f0e9f2773bda6453b60bcdb9 Mon Sep 17 00:00:00 2001 From: zotlabs Date: Sun, 2 Apr 2017 20:03:27 -0700 Subject: change hook for perm_is_allowed while retaining backwards compatibility --- include/permissions.php | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'include/permissions.php') diff --git a/include/permissions.php b/include/permissions.php index d21b45550..f719394c5 100644 --- a/include/permissions.php +++ b/include/permissions.php @@ -314,11 +314,12 @@ function perm_is_allowed($uid, $observer_xchan, $permission) { 'channel_id' => $uid, 'observer_hash' => $observer_xchan, 'permission' => $permission, - 'result' => false); + 'result' => 'unset'); call_hooks('perm_is_allowed', $arr); - if($arr['result']) - return true; + if($arr['result'] !== 'unset') { + return $arr['result']; + } $global_perms = \Zotlabs\Access\Permissions::Perms(); -- cgit v1.2.3