protected function getUserRulesForContextSave(array $actions, int $contextId) : array { $perms = []; $userIds = $this->db->first('SELECT DISTINCT userid FROM airship_perm_rules WHERE context = ? AND userid IS NOT NULL', $contextId); foreach ($userIds as $user) { $allowed = $this->getUserPerms((int) $user, $contextId); foreach ($actions as $act) { $perms[$user][$act] = \in_array($act, $allowed); } } return $perms; }