aboutsummaryrefslogtreecommitdiffstats
path: root/include/permissions.php
diff options
context:
space:
mode:
authorredmatrix <git@macgirvin.com>2016-07-09 19:03:29 -0700
committerredmatrix <git@macgirvin.com>2016-07-09 19:03:29 -0700
commit917a465ccd7dfa4992241b1e5d4418b3a31f1615 (patch)
tree4743fcfc2e9997d35c1b0ef73317002c98255b64 /include/permissions.php
parente11330a5c8e5111d08d6aee1f4dc6dda6f7c7f2a (diff)
downloadvolse-hubzilla-917a465ccd7dfa4992241b1e5d4418b3a31f1615.tar.gz
volse-hubzilla-917a465ccd7dfa4992241b1e5d4418b3a31f1615.tar.bz2
volse-hubzilla-917a465ccd7dfa4992241b1e5d4418b3a31f1615.zip
more work on perms
Diffstat (limited to 'include/permissions.php')
-rw-r--r--include/permissions.php8
1 files changed, 5 insertions, 3 deletions
diff --git a/include/permissions.php b/include/permissions.php
index dff7d65ff..5eb602ce0 100644
--- a/include/permissions.php
+++ b/include/permissions.php
@@ -291,7 +291,7 @@ function perm_is_allowed($uid, $observer_xchan, $permission) {
// First find out what the channel owner declared permissions to be.
- $channel_perm = \Zotlabs\Access\PermissionLimits($uid,$permission);
+ $channel_perm = \Zotlabs\Access\PermissionLimits::Get($uid,$permission);
$r = q("select channel_pageflags, channel_moved, channel_hash from channel where channel_id = %d limit 1",
intval($uid)
@@ -299,6 +299,9 @@ function perm_is_allowed($uid, $observer_xchan, $permission) {
if(! $r)
return false;
+
+ $blocked_anon_perms = \Zotlabs\Access\Permissions::BlockedAnonPerms();
+
if($observer_xchan) {
if($channel_perm & PERMS_AUTHED)
return true;
@@ -314,7 +317,7 @@ function perm_is_allowed($uid, $observer_xchan, $permission) {
if(($x) && intval($x[0]['abook_blocked']))
return false;
- if(($x) && (! $global_perms[$permission][2]) && intval($x[0]['abook_ignored']))
+ if(($x) && in_array($permission,$blocked_anon_perms) && intval($x[0]['abook_ignored']))
return false;
if(! $x) {
@@ -326,7 +329,6 @@ function perm_is_allowed($uid, $observer_xchan, $permission) {
$abperms = load_abconfig($uid,$observer_xchan);
}
- $blocked_anon_perms = \Zotlabs\Access\Permissions::BlockedAnonPerms();
// system is blocked to anybody who is not authenticated