diff --git a/li.strolch.privilege/src/main/java/li/strolch/privilege/policy/PrivilegePolicyHelper.java b/li.strolch.privilege/src/main/java/li/strolch/privilege/policy/PrivilegePolicyHelper.java index c0f57fb5c..d8540b339 100644 --- a/li.strolch.privilege/src/main/java/li/strolch/privilege/policy/PrivilegePolicyHelper.java +++ b/li.strolch.privilege/src/main/java/li/strolch/privilege/policy/PrivilegePolicyHelper.java @@ -63,7 +63,7 @@ public class PrivilegePolicyHelper { // first check values not allowed if (privilege.isDenied(privilegeValue)) { // then throw access denied - String msg = MessageFormat.format(PrivilegeMessages.getString("Privilege.accessdenied.noprivilege"), //$NON-NLS-1$ + String msg = MessageFormat.format(PrivilegeMessages.getString("Privilege.accessdenied.noprivilege.value"), //$NON-NLS-1$ ctx.getUsername(), privilege.getName(), privilegeValue, restrictable.getClass().getName()); throw new AccessDeniedException(msg); } @@ -73,7 +73,7 @@ public class PrivilegePolicyHelper { return; // default is not allowed - String msg = MessageFormat.format(PrivilegeMessages.getString("Privilege.accessdenied.noprivilege"), //$NON-NLS-1$ + String msg = MessageFormat.format(PrivilegeMessages.getString("Privilege.accessdenied.noprivilege.value"), //$NON-NLS-1$ ctx.getUsername(), privilege.getName(), privilegeValue, restrictable.getClass().getName()); throw new AccessDeniedException(msg); } diff --git a/li.strolch.privilege/src/main/resources/PrivilegeMessages.properties b/li.strolch.privilege/src/main/resources/PrivilegeMessages.properties index d22fc22a4..16a962ae1 100644 --- a/li.strolch.privilege/src/main/resources/PrivilegeMessages.properties +++ b/li.strolch.privilege/src/main/resources/PrivilegeMessages.properties @@ -1,4 +1,5 @@ -Privilege.accessdenied.noprivilege=User {0} does not have the privilege {1} with value {2} needed for Restrictable {3} +Privilege.accessdenied.noprivilege=User {0} does not have the privilege {1} needed for Restrictable {2} +Privilege.accessdenied.noprivilege.value=User {0} does not have the privilege {1} with value {2} needed for Restrictable {3} Privilege.illegalArgument.nonstring=\ {0} has returned a non-string privilege value\! Privilege.illegalArgument.nonrole=\ {0} did not return a Role privilege value\! Privilege.illegalArgument.noncertificate=\ {0} did not return a Certificate privilege value\! diff --git a/li.strolch.privilege/src/test/java/li/strolch/privilege/test/PrivilegeTest.java b/li.strolch.privilege/src/test/java/li/strolch/privilege/test/PrivilegeTest.java index 6f5dcacc0..cee3d6d6e 100644 --- a/li.strolch.privilege/src/test/java/li/strolch/privilege/test/PrivilegeTest.java +++ b/li.strolch.privilege/src/test/java/li/strolch/privilege/test/PrivilegeTest.java @@ -201,7 +201,7 @@ public class PrivilegeTest extends AbstractPrivilegeTest { public void testPerformSystemRestrictableFailNoAdditionalPrivilege() throws Exception { this.exception.expect(PrivilegeException.class); this.exception.expectMessage( - "User system_admin2 does not have the privilege li.strolch.privilege.handler.SystemAction needed for Restrictable li.strolch.privilege.test.model.TestSystemUserActionDeny"); + "User system_admin2 does not have the privilege li.strolch.privilege.handler.SystemAction with value li.strolch.privilege.test.model.TestSystemUserActionDeny needed for Restrictable li.strolch.privilege.test.model.TestSystemUserActionDeny"); try { // create the action to be performed as a system user TestSystemUserActionDeny action = new TestSystemUserActionDeny();