This fix needs to go deeper in the code. PermissionLimits::Get is called in a lot of places. If we have no stored setting for a particular permission, return 0 - which is basically no permission except to self.

This commit is contained in:
zotlabs 2018-04-19 23:44:22 -07:00
parent 8d0cbeab38
commit d5c451c4a8

View File

@ -74,13 +74,13 @@ class PermissionLimits {
* @param int $channel_id
* @param string $perm (optional)
* @return
* * \b boolean false if no perm_limits set for this channel
* * \b int if $perm is set, return one of PERMS_* constants for this permission
* * \b false if no perm_limits set for this channel
* * \b int if $perm is set, return one of PERMS_* constants for this permission, default 0
* * \b array with all permission limits, if $perm is not set
*/
static public function Get($channel_id, $perm = '') {
if($perm) {
return PConfig::Get($channel_id, 'perm_limits', $perm);
return intval(PConfig::Get($channel_id, 'perm_limits', $perm));
}
PConfig::Load($channel_id);