Closed Bug 1790017 Opened 2 years ago Closed 2 years ago

Add Services.perms.getAllByTypes(permissionTypes)

Categories

(Core :: Permission Manager, task)

task

Tracking

()

RESOLVED FIXED
106 Branch
Tracking Status
firefox106 --- fixed

People

(Reporter: nchevobbe, Assigned: nchevobbe)

References

Details

Attachments

(1 file)

In Bug 1778959, we need to be able to retrieve all the nsIPermissions for given permission types.
Using getAllWithTypePrefix on the different types doesn't seem efficient, and look a bit brittle (for example, the prefs we need to retrieve are midi and midi-sysex, which share the same prefix and would complexify the implementation)

Having a getAllByTypes function, taking an array of the permission types would help to have a cleaner implementation for Bug 1778959 (e.g. permissions = Services.perms.getAllWithTypes(["midi", "midi-sysex"])).

I have a patch that seems to work as expected, I'll push it for review

Assignee: nobody → nchevobbe
Status: NEW → ASSIGNED
Blocks: 1778959

This new method return an array of nsIPermission whose type are included in the
array of permission types parameter.
This will help the implementation of Bug 1778959 where we need to get all the permission
of a given Set of (gated) permission types.

Pushed by nchevobbe@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/4cd93530c1c9
Add Services.perms.getAllByTypes(permissionTypes). r=permissions-reviewers,necko-reviewers,pbz
Regressions: 1790105
Status: ASSIGNED → RESOLVED
Closed: 2 years ago
Resolution: --- → FIXED
Target Milestone: --- → 106 Branch
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: