This changes the way license usage is calculated. Previously the licenses would prohibit enumerating more than what was licensed. This had the benefit that the backup engine was unaware that more items exists.
However, this also prevented filtering items, as the enumeration happens before the filters are applied.
With the new approach, enumeration is applied without imposing limitations, but actually reading the items are limited. This allows filtering unwanted items, and they will not count towards usage.
The downside of this approach is that the backup will contain empty "folders" that could, at a glance, appear to contain everything, but are in fact just empty folders.
To mitigate this, the warning message now explictly mentions that some folders may be empty.
This PR adds a flag to the test method so we can choose to test for read-only access (needed for restore) or read-write (needed for backups).
Additionally, this PR fixes a logic bug in that the BackendSourceProvider would not actually test the connection, but just check the placeholder element returned (which is always returned). With this PR the backend's ListAsync command is tested fully.
Also renamed the methods on ISourceProvider to have the `...Async` prefix.
This replaces #6939
Instead of requesting all scopes up front, each sub-section of the backup/restore will request the permissions that are relevant for the operation.
The effect is that it is not required to grant all permissions to get a backup running. If permissions are failing, that part of the backup will generate warnings for items that are excluded.