@Test public void shouldAddPermissionWhenUsingDeprecatedParameterUser() throws OperationException { DocumentModel doc = session.getDocument(new PathRef("/src")); assertNotNull(doc.getACP()); assertNull(doc.getACP().getACL("local")); when(userManager.getUserModel("existingUser")).thenReturn(SimpleDocumentModel.ofSchemas("user")); ctx.setInput(doc); Map<String, Object> params = getParametersForAddOperation("existingUser", null, null, "Read", null, new GregorianCalendar(2018, 8, 2), new GregorianCalendar(2018, 8, 8), false, false, null); automationService.run(ctx, AddPermission.ID, params); verifyUserOrGroup("existingUser", USER); verifyNoMoreInteractions(userManager); ACL acl = doc.getACP().getACL("local"); assertNotNull(acl); assertEquals(1, acl.size()); assertExpectedPermissions(acl, params, "existingUser"); }
@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; }