mirror of
https://github.com/eclipse-sailing-analytics/sailing-analytics.git
synced 2026-09-23 22:19:13 +00:00
Bug 4986: Added test case to verify that meta permission check with
ownership lookup works for a wildcard of the action part
This commit is contained in:
+13
@@ -321,6 +321,19 @@ public class PermissionCheckerTest {
|
||||
new Ownership(user, userTenant)));
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testMetaPermissionWithOwnershipandWildcardAction() {
|
||||
RoleDefinition rd = new RoleDefinitionImpl(UUID.randomUUID(), "admin",
|
||||
Collections.singleton(WildcardPermission.builder().build()));
|
||||
user.addRole(new Role(rd, userTenant, null));
|
||||
final String objectId = "someid";
|
||||
|
||||
// wildcard for the action part
|
||||
assertTrue(PermissionChecker.checkMetaPermissionWithOwnershipResolution(
|
||||
WildcardPermission.builder().withTypes(type1).withIds(objectId).build(), allHasPermissions, user, null,
|
||||
id -> new Ownership(null, userTenant)));
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testMetaPermissionWithOwnershipResolutionForOneId() {
|
||||
RoleDefinition rd = new RoleDefinitionImpl(UUID.randomUUID(), "some_role",
|
||||
|
||||
Reference in New Issue
Block a user