Skip to content

armgit / core

Public Imported from GitHub
0

100% open-source IoT Platform - Integrate your devices, add intelligence, build custom apps

Fix with public access read for consoles

Michael Rademaker2144dc28c71e
diff --git a/manager/src/main/java/org/openremote/manager/asset/console/ConsoleResourceImpl.java b/manager/src/main/java/org/openremote/manager/asset/console/ConsoleResourceImpl.java
index bb496364b..aa47d1028 100644
--- a/manager/src/main/java/org/openremote/manager/asset/console/ConsoleResourceImpl.java
+++ b/manager/src/main/java/org/openremote/manager/asset/console/ConsoleResourceImpl.java
@@ -80,7 +80,7 @@ public class ConsoleResourceImpl extends ManagerWebResource implements ConsoleRe
consoleRegistration.getVersion(),
consoleRegistration.getPlatform(),
consoleRegistration.getProviders(),
- !isAuthenticated(),
+ true,
true);
consoleAsset.setRealmId(getRequestTenant().getId());
diff --git a/manager/src/main/java/org/openremote/manager/notification/NotificationResourceImpl.java b/manager/src/main/java/org/openremote/manager/notification/NotificationResourceImpl.java
index 833666704..3087df016 100644
--- a/manager/src/main/java/org/openremote/manager/notification/NotificationResourceImpl.java
+++ b/manager/src/main/java/org/openremote/manager/notification/NotificationResourceImpl.java
@@ -183,10 +183,12 @@ public class NotificationResourceImpl extends WebResource implements Notificatio
LOG.fine("DENIED: Anonymous request to update a notification sent to an asset that doesn't exist or isn't public");
throw new WebApplicationException("Anonymous request can only update public assets not linked to a user", FORBIDDEN);
}
- if (assetStorageService.isUserAsset(asset.getId())) {
- LOG.fine("DENIED: Anonymous request to update a notification sent to an asset that is linked to one or more users");
- throw new WebApplicationException("Anonymous request can only update public assets not linked to a user", FORBIDDEN);
- }
+
+ // Disabled until console permissions finalised
+// if (assetStorageService.isUserAsset(asset.getId())) {
+// LOG.fine("DENIED: Anonymous request to update a notification sent to an asset that is linked to one or more users");
+// throw new WebApplicationException("Anonymous request can only update public assets not linked to a user", FORBIDDEN);
+// }
} else {
// Regular users can only update notifications sent to them or assets in their realm
// Restricted users can only update notifications sent to them or assets linked to them
diff --git a/model/src/main/java/org/openremote/model/console/ConsoleConfiguration.java b/model/src/main/java/org/openremote/model/console/ConsoleConfiguration.java
index 609d20aac..f2e7ded0d 100644
--- a/model/src/main/java/org/openremote/model/console/ConsoleConfiguration.java
+++ b/model/src/main/java/org/openremote/model/console/ConsoleConfiguration.java
@@ -69,6 +69,8 @@ public final class ConsoleConfiguration {
setConsolePlatform(asset, platform);
setConsolProviders(asset, providerMap);
+ asset.setAccessPublicRead(true);
+
Meta locationMeta = new Meta(new MetaItem(RULE_STATE));
if (allowPublicLocationWrite) {
locationMeta.add(new MetaItem(ACCESS_PUBLIC_WRITE));