diff options
Diffstat (limited to 'boot.php')
-rwxr-xr-x | boot.php | 28 |
1 files changed, 18 insertions, 10 deletions
@@ -2483,19 +2483,27 @@ function check_for_new_perms() { // get the permissions role details $rp = \Zotlabs\Access\PermissionRoles::role_perms($r[0]['v']); if($rp) { - // set the channel limits if appropriate or 0 - if(array_key_exists('limits',$rp) && array_key_exists($p,$rp['limits'])) { - \Zotlabs\Access\PermissionLimits::Set($cc['uid'],$p,$rp['limits'][$p]); + + // for custom permission roles we need to customise how we initiate this new permission + if(array_key_exists('role',$rp) && ($rp['role'] === 'custom' || $rp['role'] === '')) { + \Zotlabs\Access\PermissionRoles::new_custom_perms($cc['uid'],$p,$x); } else { - \Zotlabs\Access\PermissionLimits::Set($cc['uid'],$p,0); - } + // set the channel limits if appropriate or 0 + if(array_key_exists('limits',$rp) && array_key_exists($p,$rp['limits'])) { + \Zotlabs\Access\PermissionLimits::Set($cc['uid'],$p,$rp['limits'][$p]); + } + else { + \Zotlabs\Access\PermissionLimits::Set($cc['uid'],$p,0); + } + - $set = ((array_key_exists('perms_connect',$rp) && array_key_exists($p,$rp['perms_connect'])) ? true : false); - // foreach connection set to the perms_connect value - if($x) { - foreach($x as $xx) { - set_abconfig($cc['uid'],$xx['abook_xchan'],'my_perms',$p,intval($set)); + $set = ((array_key_exists('perms_connect',$rp) && array_key_exists($p,$rp['perms_connect'])) ? true : false); + // foreach connection set to the perms_connect value + if($x) { + foreach($x as $xx) { + set_abconfig($cc['uid'],$xx['abook_xchan'],'my_perms',$p,intval($set)); + } } } } |