[Minor] Fixed tests
This commit is contained in:
parent
c6506de3ab
commit
d7931f101e
|
@ -63,7 +63,7 @@ public class PrivilegePolicyHelper {
|
||||||
// first check values not allowed
|
// first check values not allowed
|
||||||
if (privilege.isDenied(privilegeValue)) {
|
if (privilege.isDenied(privilegeValue)) {
|
||||||
// then throw access denied
|
// 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());
|
ctx.getUsername(), privilege.getName(), privilegeValue, restrictable.getClass().getName());
|
||||||
throw new AccessDeniedException(msg);
|
throw new AccessDeniedException(msg);
|
||||||
}
|
}
|
||||||
|
@ -73,7 +73,7 @@ public class PrivilegePolicyHelper {
|
||||||
return;
|
return;
|
||||||
|
|
||||||
// default is not allowed
|
// 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());
|
ctx.getUsername(), privilege.getName(), privilegeValue, restrictable.getClass().getName());
|
||||||
throw new AccessDeniedException(msg);
|
throw new AccessDeniedException(msg);
|
||||||
}
|
}
|
||||||
|
|
|
@ -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.nonstring=\ {0} has returned a non-string privilege value\!
|
||||||
Privilege.illegalArgument.nonrole=\ {0} did not return a Role privilege value\!
|
Privilege.illegalArgument.nonrole=\ {0} did not return a Role privilege value\!
|
||||||
Privilege.illegalArgument.noncertificate=\ {0} did not return a Certificate privilege value\!
|
Privilege.illegalArgument.noncertificate=\ {0} did not return a Certificate privilege value\!
|
||||||
|
|
|
@ -201,7 +201,7 @@ public class PrivilegeTest extends AbstractPrivilegeTest {
|
||||||
public void testPerformSystemRestrictableFailNoAdditionalPrivilege() throws Exception {
|
public void testPerformSystemRestrictableFailNoAdditionalPrivilege() throws Exception {
|
||||||
this.exception.expect(PrivilegeException.class);
|
this.exception.expect(PrivilegeException.class);
|
||||||
this.exception.expectMessage(
|
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 {
|
try {
|
||||||
// create the action to be performed as a system user
|
// create the action to be performed as a system user
|
||||||
TestSystemUserActionDeny action = new TestSystemUserActionDeny();
|
TestSystemUserActionDeny action = new TestSystemUserActionDeny();
|
||||||
|
|
Loading…
Reference in New Issue