Пример #1
0
 @Override
 public GroupMembership getEffectiveGroups() {
   if (effectiveGroups == null) {
     if (authConfig.isIdentityTrustable(state().getExternalIds())) {
       effectiveGroups = groupBackend.membershipsOf(this);
     } else {
       effectiveGroups = registeredGroups;
     }
   }
   return effectiveGroups;
 }
Пример #2
0
  private GroupInfo init(GroupDescription.Basic group) {
    GroupInfo info = new GroupInfo();
    info.id = Url.encode(group.getGroupUUID().get());
    info.name = Strings.emptyToNull(group.getName());
    info.url = Strings.emptyToNull(group.getUrl());
    info.options = new GroupOptionsInfo(group);

    AccountGroup g = GroupDescriptions.toAccountGroup(group);
    if (g != null) {
      info.description = Strings.emptyToNull(g.getDescription());
      info.groupId = g.getId().get();
      if (g.getOwnerGroupUUID() != null) {
        info.ownerId = Url.encode(g.getOwnerGroupUUID().get());
        GroupDescription.Basic o = groupBackend.get(g.getOwnerGroupUUID());
        if (o != null) {
          info.owner = o.getName();
        }
      }
    }

    return info;
  }