Package com.esri.gpt.framework.security.principal

Examples of com.esri.gpt.framework.security.principal.Group


public void readUserGroups(User user)
  throws IdentityException, NamingException, SQLException {
  if ((user != null) && (user.getDistinguishedName().equalsIgnoreCase(getDN()))) {
    Roles cfgRoles = getApplicationConfiguration().getIdentityConfiguration().getConfiguredRoles();
    for (Role role: cfgRoles.values()) {
      Group group = new Group();
      group.setDistinguishedName(role.getKey());
      group.setKey(role.getKey());
      group.setName(role.getKey());
      user.getGroups().add(group);
    }
  }
}
View Full Code Here


                Attribute attrName = result.getAttributes().get(sNameAttribute);
                if ((attrName != null) && (attrName.size() > 0)) {
                  sName = Val.chkStr(attrName.get(0).toString());
                }
              }
              Group group = new Group();
              group.setDistinguishedName(sDN);
              group.setKey(group.getDistinguishedName());
              group.setName(sName);
              user.getGroups().add(group);
            }
          }
        } catch (PartialResultException pre) {
          LogUtil.getLogger().finer(pre.toString());
        } catch (LimitExceededException lee) {
            LogUtil.getLogger().finer(lee.toString());
        }
      }
     
    } else {
     
      // read group membership based upon a dynamic attribute
      StringSet groupDNs = readAttribute(dirContext,sUserDN,sDynamicAttribute);
      for (String sDN: groupDNs) {
        sDN = sDN.toLowerCase();
        if (sDN.length() > 0) {
          String sName = "";
          if (sNameAttribute.length() > 0) {
            StringSet ss = readAttribute(dirContext,sDN,sNameAttribute);
            if (ss.size() > 0) {
              sName = ss.iterator().next();
            }
          }
          Group group = new Group(sDN);
          group.setDistinguishedName(sDN);
          group.setName(sName);
          user.getGroups().add(group);
        }
      }
    }
   
View Full Code Here

              if ((attrName != null) && (attrName.size() > 0)) {
                sName = Val.chkStr(attrName.get(0).toString());
              }
            }

              Group group = new Group();
              group.setDistinguishedName(sDN);
              group.setKey(group.getDistinguishedName());
              group.setName(sName);
              groups.add(group);
          }
        }
      } catch (PartialResultException pre) {
        LogUtil.getLogger().finer(pre.toString());
View Full Code Here

 
    if (selectedGroups.size() > 0) {
 
    } else {
      for (String o : pickedGroups) {
        Group group = groups.get(o);
        if (group != null) {
          selectedGroups.add(group);
        }
      }
    }
 
    StringBuffer sbAclXml = new StringBuffer();
    if (selectedGroups != null && selectedGroups.isEmpty()) {
      return null;
    }
    sbAclXml.append("<acl>");
    for (Group group : selectedGroups.values()) {
      sbAclXml.append("<principal type=\"groupDn\">");
      sbAclXml.append(Val.escapeXml(group.getDistinguishedName()));
      sbAclXml.append("</principal>");
    }
    sbAclXml.append("</acl>");
    return sbAclXml.toString();
  }
View Full Code Here

        for (int i = 0; i < principalNodes.getLength(); i++) {
          Node principalNode = principalNodes.item(i);
          NamedNodeMap attributes = principalNode.getAttributes();
          if (attributes.getNamedItem("type").getNodeValue().equalsIgnoreCase(
              "groupDn")) {
            Group group = groups.get(principalNode.getTextContent());
            if (group != null)
              selectedGroups.append(group.getName()).append(",");
          }
        }
      }
    }
 
View Full Code Here

      if (principalNodes != null && principalNodes.getLength() > 0) {
        for (int i = 0; i < principalNodes.getLength(); i++) {
          Node principalNode = principalNodes.item(i);
          NamedNodeMap attributes = principalNode.getAttributes();
          if (attributes.getNamedItem("type").getNodeValue().equalsIgnoreCase("groupDn")) {
            Group group = groups.get(principalNode.getTextContent());
            if (group != null)
              selectedGroups.append(group.getKey()).append("\u2715");
          }
        }
      }
    }
   
View Full Code Here

    // metadata management groups
    NodeList nlMmg = (NodeList) xpath.evaluate("groups/metadataManagementGroup",ndLdap,XPathConstants.NODESET);
    for (int i = 0; i < nlMmg.getLength(); i++) {
      Node ndMmg = nlMmg.item(i);
      Group group = new Group();
      group.setDistinguishedName(xpath.evaluate("@groupDN", ndMmg));
      group.setKey(group.getDistinguishedName());
      group.setName(xpath.evaluate("@name", ndMmg));
      idConfig.getMetadataManagementGroups().add(group);
    }

  }
 
View Full Code Here

TOP

Related Classes of com.esri.gpt.framework.security.principal.Group

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.