Skip to content

Add USB conditionals for moving away from --device=all and --device=usb permissions - #6560

Merged
swick merged 3 commits into
flatpak:mainfrom
swick:wip/usb-conditional-perm
Apr 16, 2026
Merged

swick merged 3 commits into
flatpak:mainfrom
swick:wip/usb-conditional-perm

Conversation

@swick

@swick swick commented Apr 7, 2026

Copy link
Copy Markdown
Collaborator

No description provided.

swick added 3 commits April 7, 2026 16:30
This can be used by apps to restrict access from `--device=all` to
`--device=usb` in a backwards compatible way:

   --device-if=all:!has-usb-device --device=usb

Closes: flatpak#6557
This can be used by apps to restrict access to `--device=usb` by using
the portal and falling back to `--device=usb` if it is not available:

   --device-if=usb:!has-usb-portal

Closes: flatpak#6557
@v1993

v1993 commented Apr 7, 2026

Copy link
Copy Markdown

Small note regarding the first commit's description: I think you'd also want --device=all first for compatibility with flatpak versions that don't support conditionals, i.e. --device=all --device-if=all:!has-usb-device --device=usb?

@swick

swick commented Apr 13, 2026

Copy link
Copy Markdown
Collaborator Author

pinging for review, @alexlarsson @bbhtt

@swick
swick added this pull request to the merge queue Apr 16, 2026
Merged via the queue into flatpak:main with commit e556544 Apr 16, 2026
11 checks passed
@swick
swick deleted the wip/usb-conditional-perm branch April 16, 2026 10:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants