mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-08-09 06:45:09 -06:00
Redirect to USB workflow if user account doesn't have permissions
If the user is not allowed to write profiles to the printers, then they'd get errors when trying to sync. Instead we'll redirect them to the USB workflow. This also works for users that have accounts but don't have the printers in the cloud. The original requirements suggest that the entire sync button must be hidden for this case. But to allow those people to still sync via USB I'm opting for this solution instead. Contributes to issue CURA-9220.
This commit is contained in:
parent
615f16bda0
commit
9d820b8d02
1 changed files with 18 additions and 2 deletions
|
@ -88,7 +88,15 @@ UM.Window
|
|||
{
|
||||
if(Cura.API.account.isLoggedIn)
|
||||
{
|
||||
swipeView.currentIndex += 2; //Skip sign in page.
|
||||
if(Cura.API.account.permissions.includes("digital-factory.printer.write"))
|
||||
{
|
||||
swipeView.currentIndex += 2; //Skip sign in page. Continue to sync via cloud.
|
||||
}
|
||||
else
|
||||
{
|
||||
//Logged in, but no permissions to start syncing. Direct them to USB.
|
||||
swipeView.currentIndex = removableDriveSyncPage.SwipeView.index;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -112,7 +120,15 @@ UM.Window
|
|||
{
|
||||
if(is_logged_in && signinPage.SwipeView.isCurrentItem)
|
||||
{
|
||||
swipeView.currentIndex += 1;
|
||||
if(Cura.API.account.permissions.includes("digital-factory.printer.write"))
|
||||
{
|
||||
swipeView.currentIndex += 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
//Logged in, but no permissions to start syncing. Direct them to USB.
|
||||
swipeView.currentIndex = removableDriveSyncPage.SwipeView.index;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue