### Question:
JcrAllowedActions extends JcrObject implements AllowedActions { @Override public void checkPermission(Action action, Action... more) { checkPermission(Stream.concat(Stream.of(action), Stream.of(more)).collect(Collectors.toSet())); } JcrAllowedActions(Node allowedActionsNode); @Override List<AllowableAction> getAvailableActions(); @Override boolean enable(Principal principal, Action action, Action... more); @Override boolean enable(Principal principal, Set<Action> actions); @Override boolean enableOnly(Principal principal, Action action, Action... more); @Override boolean enableOnly(Principal principal, Set<Action> actions); @Override boolean enableOnly(Principal principal, AllowedActions actions); @Override boolean enableAll(Principal principal); @Override boolean disable(Principal principal, Action action, Action... more); @Override boolean disable(Principal principal, Set<Action> actions); @Override boolean disable(Principal principal, AllowedActions actions); @Override boolean disableAll(Principal principal); @Override boolean hasPermission(Action action, Action... more); @Override boolean hasPermission(Set<Action> actions); @Override void checkPermission(Action action, Action... more); @Override void checkPermission(Set<Action> actions); void removeAccessControl(Principal owner); void disableAccessControl(Principal owner); void setupAccessControl(Principal owner); JcrAllowedActions copy(Node allowedNode, Principal principal, String... privilegeNames); JcrAllowedActions copy(Node allowedNode, boolean includeDescr, Principal principal, String... privilegeNames); @Override Set<Principal> getPrincipalsAllowedAll(Action action, Action... more); @Override Set<Principal> getPrincipalsAllowedAll(Set<Action> actions); @Override Set<Principal> getPrincipalsAllowedAny(Action action, Action... more); @Override Set<Principal> getPrincipalsAllowedAny(Set<Action> actions); Stream<Action> streamActions(); Stream<Action> streamLeafActions(); static final String NODE_NAME; static final String NODE_TYPE; }### Answer:
@Test(dependsOnMethods = "testAdminGetAvailable") public void testAdminGetAllowed() throws Exception { this.metadata.read(() -> { Optional<AllowedActions> option = this.provider.getAllowedActions(AllowedActions.SERVICES); assertThat(option.isPresent()).isTrue(); AllowedActions actions = option.get(); actions.checkPermission(TestSecurityConfig.EXPORT_FEEDS); }, TestSecurityConfig.ADMIN); }
@Test(dependsOnMethods = "testTestGetAvailable", expectedExceptions = AccessControlException.class) public void testTestGetAllowed() throws Exception { this.metadata.read(() -> { Optional<AllowedActions> option = this.provider.getAllowedActions(AllowedActions.SERVICES); assertThat(option.isPresent()).isTrue(); option.get().checkPermission(TestSecurityConfig.EXPORT_FEEDS); }, TestSecurityConfig.TEST); }