public void testAuthoriseAccessMethodWhenMatchingAcessOperationsAllowedOnSpecifiedComponent() throws ConfigurationException
{
final RuleSet rs = new RuleSet();
// grant user9 all rights on "getAttribute*" methods in Test component
ObjectProperties ruleProperties = new ObjectProperties();
ruleProperties.put(ObjectProperties.Property.COMPONENT, "Test");
ruleProperties.put(ObjectProperties.Property.NAME, "getAttribute*");
rs.grant(1, "user9", Permission.ALLOW, Operation.ACCESS, ObjectType.METHOD, ruleProperties);
configureAccessControl(rs);
SecurityManager.setThreadSubject(TestPrincipalUtils.createTestSubject("user9"));
ObjectProperties properties = new ObjectProperties("getAttributes");
properties.put(ObjectProperties.Property.COMPONENT, "Test");
Result result = _plugin.authorise(Operation.ACCESS, ObjectType.METHOD, properties);
assertEquals(Result.ALLOWED, result);
properties = new ObjectProperties("getAttribute");
properties.put(ObjectProperties.Property.COMPONENT, "Test");
result = _plugin.authorise(Operation.ACCESS, ObjectType.METHOD, properties);
assertEquals(Result.ALLOWED, result);
properties = new ObjectProperties("getAttribut");
properties.put(ObjectProperties.Property.COMPONENT, "Test");
result = _plugin.authorise(Operation.ACCESS, ObjectType.METHOD, properties);
assertEquals(Result.DEFER, result);
}