@Test void testGetInheritedPermissions() { Sid user = mock(PrincipalSid.class); Sid role1Sid = new GrantedAuthoritySid("ROLE_role1"); Sid role2Sid = new GrantedAuthoritySid("ROLE_role2"); Sid role3Sid = new GrantedAuthoritySid("ROLE_role3"); Acl parentPackageAcl = PermissionTestUtils.getSinglePermissionAcl(role3Sid, 16, "parentPackageAcl"); Acl packageAcl = PermissionTestUtils.getSinglePermissionAcl(user, 4, "packageAcl", parentPackageAcl); Acl entityAcl = PermissionTestUtils.getSinglePermissionAcl(role2Sid, 8, "entityAcl", packageAcl); doReturn(Arrays.asList(role1Sid, role2Sid)).when(userRoleTools).getRolesForSid(user); doReturn(singletonList(role3Sid)).when(userRoleTools).getRolesForSid(role1Sid); InheritedPermissionsResult expected = getInheritedPermissionsResult(packageAcl, parentPackageAcl, role1Sid, role2Sid, role3Sid); assertEquals(expected, resolver.getInheritedPermissionsResults(entityAcl, user)); }
public Set<LabelledPermission> getInheritedPermissions(Acl acl, Sid sid) { InheritedPermissionsResult inheritedPermissionsResult = getInheritedPermissionsResults(acl, sid); return convertToInheritedPermissions(inheritedPermissionsResult); }
PermissionInheritanceResolver { public Set<LabelledPermission> getInheritedPermissions(Acl acl, Sid sid) { InheritedPermissionsResult inheritedPermissionsResult = getInheritedPermissionsResults(acl, sid); return convertToInheritedPermissions(inheritedPermissionsResult); } }
PermissionInheritanceResolver { public Set<LabelledPermission> getInheritedPermissions(Acl acl, Sid sid) { InheritedPermissionsResult inheritedPermissionsResult = getInheritedPermissionsResults(acl, sid); return convertToInheritedPermissions(inheritedPermissionsResult); } PermissionInheritanceResolver(UserRoleTools userRoleTools, EntityHelper entityHelper); }
PermissionInheritanceResolver { public Set<LabelledPermission> getInheritedPermissions(Acl acl, Sid sid) { InheritedPermissionsResult inheritedPermissionsResult = getInheritedPermissionsResults(acl, sid); return convertToInheritedPermissions(inheritedPermissionsResult); } PermissionInheritanceResolver(UserRoleTools userRoleTools, EntityHelper entityHelper); Set<LabelledPermission> getInheritedPermissions(Acl acl, Sid sid); }
PermissionInheritanceResolver { public Set<LabelledPermission> getInheritedPermissions(Acl acl, Sid sid) { InheritedPermissionsResult inheritedPermissionsResult = getInheritedPermissionsResults(acl, sid); return convertToInheritedPermissions(inheritedPermissionsResult); } PermissionInheritanceResolver(UserRoleTools userRoleTools, EntityHelper entityHelper); Set<LabelledPermission> getInheritedPermissions(Acl acl, Sid sid);  }