From a961d5e6c8cd79b375e13a0b3d887e521392f8aa Mon Sep 17 00:00:00 2001 From: redmatrix Date: Tue, 19 Jul 2016 20:49:54 -0700 Subject: permission fixes --- Zotlabs/Lib/PermissionDescription.php | 17 ++++------------- 1 file changed, 4 insertions(+), 13 deletions(-) (limited to 'Zotlabs/Lib') diff --git a/Zotlabs/Lib/PermissionDescription.php b/Zotlabs/Lib/PermissionDescription.php index 55aac2dea..b6c6dd29d 100644 --- a/Zotlabs/Lib/PermissionDescription.php +++ b/Zotlabs/Lib/PermissionDescription.php @@ -78,22 +78,13 @@ class PermissionDescription { $result = null; - $global_perms = get_perms(); + $global_perms = \Zotlabs\Access\Permissions::Perms(); if (array_key_exists($permname, $global_perms)) { - $permDetails = $global_perms[$permname]; - - // It should be OK to always just read the permissions from App::$channel - // - // App::$profile is a union of channel and profile fields. - // The distinction is basically that App::$profile is pointing to the resource - // being observed. App::$channel is referring to the current logged-in channel - // member (if this is a local channel) e.g. the observer. We only show the ACL - // widget to the page owner (observer and observed are the same) so in that case - // I believe either may be safely used here. - $channelPerm = \App::$channel[$permDetails[0]]; - $result = new PermissionDescription($permDetails[1], $channelPerm); + $channelPerm = \Zotlabs\Access\PermissionLimits::Get(\App::$channel['channel_id'],$permname); + + $result = new PermissionDescription('', $channelPerm); } else { // The acl dialog can handle null arguments, but it shouldn't happen logger('null PermissionDescription from unknown global permission: ' . $permname ,LOGGER_DEBUG, LOG_ERROR); -- cgit v1.2.3