@elementor/editor-global-classes 3.32.0-38 → 3.32.0-39

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/dist/index.mjs CHANGED
@@ -1981,6 +1981,7 @@ function PopulateStore() {
1981
1981
  }
1982
1982
 
1983
1983
  // src/sync-with-document-save.ts
1984
+ import { getCurrentUser } from "@elementor/editor-current-user";
1984
1985
  import { setDocumentModifiedStatus as setDocumentModifiedStatus2 } from "@elementor/editor-documents";
1985
1986
  import { registerDataHook } from "@elementor/editor-v1-adapters";
1986
1987
  import { __getState as getState3, __subscribeWithSelector as subscribeWithSelector2 } from "@elementor/store";
@@ -1999,6 +2000,11 @@ function syncDirtyState() {
1999
2000
  }
2000
2001
  function bindSaveAction() {
2001
2002
  registerDataHook("after", "document/save/save", (args) => {
2003
+ const user = getCurrentUser();
2004
+ const canEdit = user?.capabilities.includes(UPDATE_CLASS_CAPABILITY_KEY);
2005
+ if (!canEdit) {
2006
+ return;
2007
+ }
2002
2008
  return saveGlobalClasses({
2003
2009
  context: args.status === "publish" ? "frontend" : "preview"
2004
2010
  });