Commit 6f253335 authored by Matija Obreza's avatar Matija Obreza

Fix: CurrentPermissionsWriter for ADMIN

parent cd95da72
...@@ -100,16 +100,16 @@ public class CurrentPermissionsWriter extends VirtualBeanPropertyWriter { ...@@ -100,16 +100,16 @@ public class CurrentPermissionsWriter extends VirtualBeanPropertyWriter {
if (SecurityContextUtil.hasRole("ADMINISTRATOR")) { if (SecurityContextUtil.hasRole("ADMINISTRATOR")) {
perms.grantAll(); perms.grantAll();
} } else {
try {
try { perms.create = SecurityContextUtil.hasPermission(bean, BasePermission.CREATE);
perms.create = SecurityContextUtil.hasPermission(bean, BasePermission.CREATE); perms.read = SecurityContextUtil.hasPermission(bean, BasePermission.READ);
perms.read = SecurityContextUtil.hasPermission(bean, BasePermission.READ); perms.write = SecurityContextUtil.hasPermission(bean, BasePermission.WRITE);
perms.write = SecurityContextUtil.hasPermission(bean, BasePermission.WRITE); perms.delete = SecurityContextUtil.hasPermission(bean, BasePermission.DELETE);
perms.delete = SecurityContextUtil.hasPermission(bean, BasePermission.DELETE); perms.manage = SecurityContextUtil.hasPermission(bean, BasePermission.ADMINISTRATION);
perms.manage = SecurityContextUtil.hasPermission(bean, BasePermission.ADMINISTRATION); } catch (Throwable e) {
} catch (Throwable e) { LOG.warn("Could not read current permissions {}", e.getMessage());
LOG.warn("Could not read current permissions {}", e.getMessage()); }
} }
return perms; return perms;
} }
......
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