mirror of
https://git.mirrors.martin98.com/https://github.com/Ultimaker/Cura
synced 2025-05-01 00:04:27 +08:00
Add property of whether the printer details can be read
We'd assume so, but there is a permissions node for it. If it can't be read by the user, they can't navigate to the printer's overview page. So we should hide the button then. Contributes to issue CURA-9220.
This commit is contained in:
parent
e9f9730364
commit
19ba092340
@ -366,6 +366,13 @@ class CloudOutputDevice(UltimakerNetworkedPrinterOutputDevice):
|
||||
"""
|
||||
return "digital-factory.print-job.write.own" in self._account.permissions
|
||||
|
||||
@pyqtProperty(bool, constant = True)
|
||||
def canReadPrinterDetails(self) -> bool:
|
||||
"""
|
||||
Whether this user can read the status of the printer.
|
||||
"""
|
||||
return "digital-factory.printer.read" in self._account.permissions
|
||||
|
||||
@property
|
||||
def clusterData(self) -> CloudClusterResponse:
|
||||
"""Gets the cluster response from which this device was created."""
|
||||
|
@ -213,6 +213,13 @@ class UltimakerNetworkedPrinterOutputDevice(NetworkedPrinterOutputDevice):
|
||||
"""
|
||||
return True
|
||||
|
||||
@pyqtProperty(bool, constant = True)
|
||||
def canReadPrinterDetails(self) -> bool:
|
||||
"""
|
||||
Whether this user can read the status of the printer.
|
||||
"""
|
||||
return True
|
||||
|
||||
@pyqtSlot(name="openPrintJobControlPanel")
|
||||
def openPrintJobControlPanel(self) -> None:
|
||||
raise NotImplementedError("openPrintJobControlPanel must be implemented")
|
||||
|
Loading…
x
Reference in New Issue
Block a user