@iobroker/gui-components 10.4.0 → 10.4.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -36,7 +36,7 @@ npm create vite@latest src -- --template react-ts
36
36
  "dependencies": {
37
37
  "@emotion/react": "^11.14.0",
38
38
  "@emotion/styled": "^11.14.1",
39
- "@iobroker/gui-components": "^10.4.0",
39
+ "@iobroker/gui-components": "^10.4.2",
40
40
  "@mui/icons-material": "^9.0.1",
41
41
  "@mui/material": "^9.0.1",
42
42
  "react": "^19.2.5",
@@ -877,6 +877,14 @@ You can find the migration instructions:
877
877
  -->
878
878
 
879
879
  ## Changelog
880
+ ### 10.4.2 (2026-11-05)
881
+ - (@GermanBluefox) Added: `ObjectBrowser` prop `objectsNotEditable`: objects read-only, state values still editable
882
+ - (@GermanBluefox) Added: `ObjectBrowser` checks the rights of each object: no edit or delete where the user may not
883
+
884
+ ### 10.4.1 (2026-11-05)
885
+ - (@GermanBluefox) Changed: `UploadImage`: the upload symbol is animated (it bobs while a file is dragged over the drop area and moves up while the file is read), the drop area pulses while a file is dragged over it, also over an existing image, and a new image fades in
886
+ - (@GermanBluefox) Added: `UploadImage` got the props `uploading` and `uploadError`: while the parent uploads the image (e.g. writes it into a file) an upload arrow is shown in the corner of the image, followed by a check mark or a cross
887
+
880
888
  ### 10.4.0 (2026-11-04)
881
889
  - (@GermanBluefox) Changed: the animated trash can is used for all delete buttons: file browser, `TreeTable`, `ColorPicker`, `DialogComplexCron` and the context menu of the object browser. The lid stays open while the delete confirmation is shown
882
890
  - (@GermanBluefox) Changed: file browser: the reload button turns while the files are read
@@ -248,6 +248,17 @@ export declare class ObjectBrowserClass extends Component<ObjectBrowserProps, Ob
248
248
  * @param id ID of the object
249
249
  */
250
250
  isDeleteAllowed(id: string): boolean;
251
+ /**
252
+ * May the user change this object (`object`) or the value of this state (`state`)? Asks the
253
+ * connection, which knows the rights of the group of the user and checks the rights of the object
254
+ * itself (`obj.acl`) as js-controller does. Without known rights - or with a connection that
255
+ * cannot tell - the answer is yes and the server decides.
256
+ *
257
+ * @param obj the object
258
+ * @param part `object` for the object itself, `state` for the value of a state
259
+ * @param operation `delete` to delete the object
260
+ */
261
+ mayChange(obj: ioBroker.Object | null | undefined, part?: 'object' | 'state', operation?: 'write' | 'delete'): boolean;
251
262
  /**
252
263
  * Show the deletion dialog for a given object
253
264
  */
@@ -845,6 +845,22 @@ export class ObjectBrowserClass extends Component {
845
845
  isDeleteAllowed(id) {
846
846
  return this.state.filter.expertMode || USER_OWNED_NAMESPACES.some(prefix => id.startsWith(prefix));
847
847
  }
848
+ /**
849
+ * May the user change this object (`object`) or the value of this state (`state`)? Asks the
850
+ * connection, which knows the rights of the group of the user and checks the rights of the object
851
+ * itself (`obj.acl`) as js-controller does. Without known rights - or with a connection that
852
+ * cannot tell - the answer is yes and the server decides.
853
+ *
854
+ * @param obj the object
855
+ * @param part `object` for the object itself, `state` for the value of a state
856
+ * @param operation `delete` to delete the object
857
+ */
858
+ mayChange(obj, part = 'object', operation = 'write') {
859
+ // `hasObjectPermission` came with @iobroker/socket-client 5.6.0. Described here, so that this
860
+ // compiles and runs with an older socket client as well - which does not know the method
861
+ const socket = this.props.socket;
862
+ return typeof socket?.hasObjectPermission !== 'function' || socket.hasObjectPermission(obj, operation, part);
863
+ }
848
864
  /**
849
865
  * Show the deletion dialog for a given object
850
866
  */