SimpleDesk

SimpleDesk! => SimpleDesk Support => Topic started by: luckyspoon on December 07, 2022, 08:26:02 PM

Title: Permissions Issues
Post by: luckyspoon on December 07, 2022, 08:26:02 PM

      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
Title: Re: Permissions Issues
Post by: luckyspoon on December 07, 2022, 08:58:51 PM
(https://i.imgur.com/B1lazar.png)

(https://i.imgur.com/IKLFt6q.png)
Title: Re: Permissions Issues
Post by: luckyspoon on December 07, 2022, 09:03:02 PM
This is what the user sees:
(there's actually about a dozen tickets)

(https://i.imgur.com/QsohKGf.png)
Title: Re: Permissions Issues
Post by: luckyspoon on December 14, 2022, 01:10:02 AM
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]);
}