@Override public void performVoid() throws RepositoryException { delegate.setProperty(relPath, value); } });
@Override public void performVoid() throws RepositoryException { delegate.setProperty(relPath, value); } });
@Override public void performVoid() throws RepositoryException { delegate.setProperty(relPath, value); } });
@Override public void performVoid() throws RepositoryException { delegate.setProperty(relPath, value); } });
@Override public void performVoid() throws RepositoryException { delegate.setProperty(relPath, value); } });
@Override public void performVoid() throws RepositoryException { delegate.setProperty(relPath, value); } });
private static void setProperty(String relPath, Value value, Authorizable... authorizables) throws RepositoryException { for (Authorizable authorizable : authorizables) { authorizable.setProperty(relPath, value); } }
@Override public void setProperty(String s, Value[] values) throws RepositoryException { try { dlg.setProperty(s, values); } finally { mgr.autosave(); } }
private static void setProperty(String relPath, Value value, Authorizable... authorizables) throws RepositoryException { for (Authorizable authorizable : authorizables) { authorizable.setProperty(relPath, value); } }
@Override public void setProperty(String s, Value value) throws RepositoryException { try { dlg.setProperty(s, value); } finally { mgr.autosave(); } }
@Override public void setProperty(String s, Value value) throws RepositoryException { try { dlg.setProperty(s, value); } finally { mgr.autosave(); } }
@Override public void setProperty(String s, Value value) throws RepositoryException { try { dlg.setProperty(s, value); } finally { mgr.autosave(); } }
public void setProperty(String name, Value value) throws RepositoryException { user.setProperty(name, value); }
@Override public void setProperty(String s, Value[] values) throws RepositoryException { try { dlg.setProperty(s, values); } finally { mgr.autosave(); } }
@Override public void setProperty(String s, Value[] values) throws RepositoryException { try { dlg.setProperty(s, values); } finally { mgr.autosave(); } }
public void setProperty(String name, Value[] values) throws RepositoryException { user.setProperty(name, values); }
@Test public void testSetProperty() throws Exception { for (String relPath : mappedPaths) { authorizable.setProperty(relPath, nameValue); authorizable.setProperty(relPath, new Value[] {nameValue}); } }
/** * Sets the {@link #REP_EXTERNAL_ID} as obtained from {@code externalIdentity} * to the specified {@code authorizable} (user or group). The property is * a single value of type {@link javax.jcr.PropertyType#STRING STRING}. * * @param authorizable The user or group that needs to get the {@link #REP_EXTERNAL_ID} property set. * @param externalIdentity The {@link ExternalIdentity} from which to retrieve the value of the property. * @throws RepositoryException If setting the property using {@link Authorizable#setProperty(String, Value)} fails. */ private void setExternalId(@NotNull Authorizable authorizable, @NotNull ExternalIdentity externalIdentity) throws RepositoryException { log.debug("Fallback: setting rep:externalId without adding the corresponding mixin type"); authorizable.setProperty(REP_EXTERNAL_ID, valueFactory.createValue(externalIdentity.getExternalId().getString())); }
@Test public void testChangeUserPropertiesWithoutPermission() throws Exception { createUser(userId); // testSession has read-only access UserManager testUserMgr = getUserManager(testSession); try { Authorizable a = testUserMgr.getAuthorizable(userId); a.setProperty("someProp", testSession.getValueFactory().createValue("value")); testSession.save(); fail("Test session doesn't have sufficient permission to alter user properties."); } catch (AccessDeniedException e) { // success } }
@Test public void testSyncUserByIdUpdate() throws Exception { ExternalIdentity externalId = idp.listUsers().next(); Authorizable a = userManager.createUser(externalId.getId(), null); a.setProperty(DefaultSyncContext.REP_EXTERNAL_ID, valueFactory.createValue(externalId.getExternalId().getString())); syncContext.setForceUserSync(true); SyncResult result = syncContext.sync(externalId.getId()); assertEquals(SyncResult.Status.UPDATE, result.getStatus()); Tree t = r.getTree(a.getPath()); assertTrue(t.hasProperty(ExternalIdentityConstants.REP_EXTERNAL_PRINCIPAL_NAMES)); }