Permissions Issues

Started by luckyspoon, December 07, 2022, 08:26:02 PM

Previous topic - Next topic

luckyspoon


      SimpleDesk version: SimpleDesk 2.0 Anatidae
      SMF version: SMF 2.0.19

      Hi Team - I am having an issue where helpdesk staff can't access 'any' tickets in their assigned departments plus a few other permissions issues.

I have 6 departments which almost all users have access to. Then each department has it's own staff role with associated membergroups, plus an overall 'staff leader' role with access to every department at a medium-high level, then the administrator role.

If I look at a users permissions via their profile it looks correct but from thier perspective accessing the helpdesk it doesn't work correctly.

Thanks


luckyspoon

This is what the user sees:
(there's actually about a dozen tickets)


luckyspoon

I fixed this.

Subs-SimpleDeskPermissions.php:364 needs to factor in the key already existing.

if(!array_key_exists($perm,$user_info['shd_permissions'])){
    $user_info['shd_permissions'][$perm] = $depts[$role];
} else {
    $user_info['shd_permissions'][$perm] = array_merge($user_info['shd_permissions'][$perm],$depts[$role]);
}