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