【问题标题】:Directory API get organization unit for by userid and add user to a organization unitDirectory API 通过用户 ID 获取组织单位并将用户添加到组织单位
【发布时间】:2015-04-08 19:05:36
【问题描述】:

如何将用户添加到组织单元并使用目录 API 通过用户 ID 获取组织单元信息?

是这样的吗?

List<OrgUnit> list = new ArrayList<OrgUnit>();
OrgUnit ou= new OrgUnit();
ou.setName(orgunit);
getDirectoryService().orgunits().insert(username, ou).execute();

OrgUnit ou = getDirectoryService().orgunits().get(userid, list).execute();

【问题讨论】:

    标签: google-directory-api


    【解决方案1】:

    我们需要通过用户对象更新组织单位。 用户 user=getDirectoryService().users().get(username.execute(); user.setOrgUnitPath(orgunit); getDirectoryService().users().update(username, user).execute();

    为用户获取组织单位: 用户 user=getDirectoryService().users().get(username).execute(); 返回用户.getOrgUnitPath();

    【讨论】:

      猜你喜欢
      • 2015-11-28
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2020-12-05
      • 1970-01-01
      相关资源
      最近更新 更多