Otherwise you have to wait until the access token refreshes, and are in a weird state in between that time where you _are_ logged in, and we even have the subscription-level, but the permission-list are empty. Now you just have to wait until the permissions return from the server after login, which shouldn't be a problem unless our users are speedrunners.
fixes internal ticket CURA-12076
Since the permissions can only change with a token, we only need to
check what the permissions at that moment (instead of every 60 seconds)
Fixes CURA-11870
Updated account syncing functionality for logged-in and non-logged-in sessions in Ultimaker. More specifically, syncing is now engaged when the UI becomes visible and stopped when adding a machine action is triggered. The modifications also include fallback to login if the user is not logged in.
CURA-11465
This incurs another request every minute. But it's not provided by the log-in itself and can change, so that'll be necessary.
Contributes to issue CURA-9220.
The return type missing caused the type checker to think it returned Any, which is clearly not true. And the type missing from _user_profile caused it to think it always had to be None, which is nonsense in any application.
Contributes to issue CURA-8539.
Conflicts:
cura/Machines/Models/MaterialManagementModel.py -> On Master we had temporarily reverted the action of this button because it became apparent that the sync wasn't going to be in 4.12. That revert is no longer necessary if this is merged.
Added a dictionary where additional user rights can be set.
A plugin such as the DigitalFactory can update this dictionary
if certain account rights change. The `account.additionalRights`
is intended to allow us some flexibility, without breaking the API
in the future.
The Application Switcher now queries the additional account rights,
which is updated by the DF plugin to only show `My printers`,
`Digital Library` and `Print jobs` when the user has access to the
DF.
Contributes to CURA-8624
If the user account scope is outdated, delete it when upgrading from 4.8 to 4.9. This means that
the user will have to log in again, to make sure they get the correct account scope.
CURA-8093
The autosync, which happens every 30 seconds, will now also inform the
connection status when the get request succeeds or fails, which is an
indicator of whether the internet is reachable.
CURA-7492
This was achieved by adding an IDLE state, which is the default state
when opening the account management popup. The state is now reseted
when the popup opens instead of when it closes. In addition, now either
the "You are in sync with your account" label or the "Check account for
updates" button will appear in the popup based on the state, not both.
Finally, with theses changes, if the popup is open and an autosync
occurs, the user will be informed that the account is synced and he/she
will have to close and reopen the popup in order to trigger a manual
update.
CURA-7290