SecurityService extends DefaultComponent { public String[] getPermissionsToCheck(String permission) { String[] groups = permissionProvider.getPermissionGroups(permission); if (groups == null) { return new String[] { permission, SecurityConstants.EVERYTHING }; } else { String[] perms = new String[groups.length + 2]; perms[0] = permission; System.arraycopy(groups, 0, perms, 1, groups.length); perms[groups.length + 1] = SecurityConstants.EVERYTHING; return perms; } }  @Override void activate(ComponentContext context); @Override void deactivate(ComponentContext context); @Override void registerContribution(Object contribution,
            String extensionPoint, ComponentInstance contributor); @Override void unregisterContribution(Object contribution,
            String extensionPoint, ComponentInstance contributor); PermissionProvider getPermissionProvider(); boolean arePoliciesRestrictingPermission(String permission); boolean arePoliciesExpressibleInQuery(String repositoryName); Collection<SQLQuery.Transformer> getPoliciesQueryTransformers(
            String repositoryName); boolean checkPermission(Document doc, Principal principal,
            String permission); String[] getPermissionsToCheck(String permission); static String[] getPrincipalsToCheck(Principal principal); @SuppressWarnings("unchecked") @Override T getAdapter(Class<T> adapter); static final ComponentName NAME; static final String PERMISSIONS_EXTENSION_POINT; }
@Test public void testGetPermissionsToCheck() { List<String> perms = Arrays.asList(service.getPermissionsToCheck(SecurityConstants.READ)); assertEquals(4, perms.size()); assertTrue(perms.contains(SecurityConstants.READ)); assertTrue(perms.contains(SecurityConstants.EVERYTHING)); }