Commit a05c6557 authored by Matija Obreza's avatar Matija Obreza

Fix: Permissions.public = false when EVERYONE's permissions cannot be read

parent b89154be
......@@ -96,8 +96,13 @@ public class CurrentPermissionsWriter extends VirtualBeanPropertyWriter {
}
Permissions perms = new Permissions();
perms.isPublic = SecurityContextUtil.anyoneHasPermission(bean, "READ");
try {
perms.isPublic = SecurityContextUtil.anyoneHasPermission(bean, "READ");
} catch (Throwable e) {
LOG.warn("Could not read public permissions {}", e.getMessage());
perms.isPublic = false;
}
if (SecurityContextUtil.hasRole("ADMINISTRATOR")) {
perms.grantAll();
} else {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment