From d84f0030beaf353b3bd3e02e21019663988227ef Mon Sep 17 00:00:00 2001 From: Mario Date: Fri, 16 Oct 2020 10:21:58 +0000 Subject: on refresh, always set all perms --- Zotlabs/Lib/Libzot.php | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) (limited to 'Zotlabs') diff --git a/Zotlabs/Lib/Libzot.php b/Zotlabs/Lib/Libzot.php index 44f1f399e..f0fe3ab24 100644 --- a/Zotlabs/Lib/Libzot.php +++ b/Zotlabs/Lib/Libzot.php @@ -326,14 +326,10 @@ class Libzot { if($permissions && is_array($permissions)) { $old_read_stream_perm = get_abconfig($channel['channel_id'],$x['hash'],'their_perms','view_stream'); - // We need to reset their_perms prior to setting the new ones. - // Otherwise withdrawn permissions will not take effect locally. - q("DELETE FROM abconfig WHERE chan = %d AND xchan = '%s' AND cat = 'their_perms'", - intval($channel['channel_id']), - dbesc($x['hash']) - ); - foreach($permissions as $p) { - set_abconfig($channel['channel_id'],$x['hash'],'their_perms',$p,'1'); + $permissions = Permissions::FilledPerms($permissions); + + foreach($permissions as $k => $v) { + set_abconfig($channel['channel_id'],$x['hash'],'their_perms',$k,$v); } } -- cgit v1.2.3