aem - 通过 sling 重命名用户

标签 aem sling crx

我们有一个外部身份管理系统,它必须使用 Sling 和 REST 管理 CQ5 中用户的生命周期。

我们能够创建和删除用户和组

  • 创造
    POST http://$host:$port/libs/cq/security/authorizables/POST 
    
    Content: rep:userId=example@example.org&givenName=Example&familyName=Example&email=example@example.org&rep:password=random
    
  • 删除
    POST http://$host:$port/home/users/e/example@example.org.delete.json
    Content: deleteAuthorizable=1
    

  • 我们的问题是我们没有找到 的方法。重命名 一个用户(或一个组)。

    我们如何重命名用户?

    我们找到的唯一解决方案是
  • 列出用户的所有组成员
  • 删除用户
  • 创建新用户
  • 重新创建所有组成员

  • 虽然这个解决方案可以工作,但它很可能会带来一些性能问题(我们有超过 70K 的用户和超过 15K 的组)。如果这是唯一的解决方案:我们如何通过 REST 有效地执行第一步(列出所有成员)

    最佳答案

    知道这并不能解决您的问题,而只是指出通过 REST 重命名似乎是不可行的。 docs似乎相当明确:

    The jackrabbit-usermanager bundle delivers a REST interface to create, update and delete users and groups in the JCR.

    To update an existing user POST a request to /system/userManager/user/username.update.. You can NOT update the username or the password (see Change Password below) only the additional properties are updateable through this URL.


    虽然在同一页面上,但似乎对特定用户的查询应该带回他们的组成员身份:
    $ curl http://localhost:8080/system/userManager/user/admin.tidy.1.json
    
    {
        "memberOf": [],
        "declaredMemberOf": []
    }
    
    不确定 CQ 是否以这种方式锁定对用户信息的访问。

    关于aem - 通过 sling 重命名用户,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/11219976/

    相关文章:

    aem - 如何在 Excel 中导出 AEM 报告?

    java - 如果我在 cq5 Web 应用程序中有多个调度程序,谁充当负载均衡器?

    apache - 如何在 tomcat 上部署现有的 apache sling 存储库?

    java - 使用 xsl 转换创建文档时忽略无效的 xml

    aem - CQ5 页面中的多个段落不起作用

    jsp - CQ5/Sling - 处理 POST 请求

    jackrabbit - 如何自动为 JCR 节点应用权限?

    java - 如何检查 String[] 类型的页面属性?

    adobe - 如何在 adobe cq5 中使组件只能由管理员编辑?