change hook for perm_is_allowed while retaining backwards compatibility

This commit is contained in:
zotlabs 2017-04-02 20:03:27 -07:00
parent 4a49643bcd
commit af14020e42

View File

@ -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();