ThreadSession.set(session);
boolean result = false;
// exact match
Authorizer authorizer = SystemAuthorizer.get();
result = authorizer.
hasPermission(projectId, personId, "system.project", 1, "testpermission");
assertTrue("wrong result", result);
// no match
result = authorizer.
hasPermission(projectId, personId, "system.project", 10, "testpermission");
assertFalse("wrong result", result);
// resource type wildcard, resourceId wildcard, permission name wildcard
// viewer role
result = authorizer.
hasPermission(projectId, personId, "system.project.iteration.story", 10, "read.test");
assertTrue("wrong result", result);
// resource type wildcard, resourceId exact match, permission name wildcard
// editor role
result = authorizer.
hasPermission(projectId, personId, "system.project.iteration.story", 10, "read.test");
assertTrue("wrong result", result);
// resource type wildcard, resourceId non match, permission name wildcard
result = authorizer.
hasPermission(projectId, personId, "system.project.iteration.story", 11, "write.test");
assertFalse("wrong result", result);
}