@Test public void shouldAddPermissionWhenUsingDeprecatedUserAndUsersParametersCombined() throws OperationException { DocumentModel doc = session.getDocument(new PathRef("/src")); assertNotNull(doc.getACP()); assertNull(doc.getACP().getACL("local")); List<String> users = Arrays.asList("existingUser2", "existingUser3"); when(userManager.getUserModel("existingUser1")).thenReturn(SimpleDocumentModel.ofSchemas("user")); when(userManager.getUserModel("existingUser2")).thenReturn(SimpleDocumentModel.ofSchemas("user")); when(userManager.getUserModel("existingUser3")).thenReturn(SimpleDocumentModel.ofSchemas("user")); ctx.setInput(doc); Map<String, Object> params = getParametersForAddOperation("existingUser1", users, null, "Write", null, null, null, false, false, null); automationService.run(ctx, AddPermission.ID, params); verifyUserOrGroup("existingUser1", USER); verifyUserOrGroup("existingUser2", USER); verifyUserOrGroup("existingUser3", USER); verifyNoMoreInteractions(userManager); ACL acl = doc.getACP().getACL("local"); assertNotNull(acl); assertEquals(3, acl.size()); assertExpectedPermissions(acl, params, "existingUser1"); assertExpectedPermissions(acl, params, "existingUser2"); assertExpectedPermissions(acl, params, "existingUser3"); }
@OperationMethod(collector = DocumentModelCollector.class) public DocumentModel run(DocumentModel doc) { validateParameters(); addPermission(doc); return doc; }
AddPermission { @OperationMethod(collector = DocumentModelCollector.class) public DocumentModel run(DocumentModel doc) { validateParameters(); addPermission(doc); return doc; } }
AddPermission { @OperationMethod(collector = DocumentModelCollector.class) public DocumentModel run(DocumentModel doc) { validateParameters(); addPermission(doc); return doc; }  }
AddPermission { @OperationMethod(collector = DocumentModelCollector.class) public DocumentModel run(DocumentModel doc) { validateParameters(); addPermission(doc); return doc; }  @OperationMethod(collector = DocumentModelCollector.class) DocumentModel run(DocumentModel doc); @OperationMethod(collector = DocumentModelCollector.class) DocumentModel run(DocumentRef docRef); }
AddPermission { @OperationMethod(collector = DocumentModelCollector.class) public DocumentModel run(DocumentModel doc) { validateParameters(); addPermission(doc); return doc; }  @OperationMethod(collector = DocumentModelCollector.class) DocumentModel run(DocumentModel doc); @OperationMethod(collector = DocumentModelCollector.class) DocumentModel run(DocumentRef docRef); static final String ID; static final String NOTIFY_KEY; static final String COMMENT_KEY; static final String ALLOW_VIRTUAL_USER; }