Package com.esri.gpt.framework.security.metadata

Examples of com.esri.gpt.framework.security.metadata.MetadataAcl


      if (uuid.length() > 0) {
       
        // ensure access to the document
        boolean bCheckAccess = true;
        if (bCheckAccess) {
          MetadataAcl acl = new MetadataAcl(context);
          boolean bHasAccess = acl.hasReadAccess(context.getUser(),uuid);
          if (!bHasAccess) {
            throw new NotAuthorizedException("Access denied");
          }
        }
 
View Full Code Here


    // ensure acl access
    RequestContext rContext = context.getRequestContext();
    AuthenticationStatus auth = rContext.getUser().getAuthenticationStatus();
    boolean bAdmin = auth.getAuthenticatedRoles().hasRole("gptAdministrator");
    if (!bAdmin) {     
      MetadataAcl acl = new MetadataAcl(rContext);
      if (!acl.isPolicyUnrestricted()) {
        LuceneIndexAdapter adapter = new LuceneIndexAdapter(rContext);
        String[] resourceAcls = adapter.queryAcls(resourceId);
        if ((resourceAcls != null) && (resourceAcls.length > 0)) {
         
          String[] userAcls = acl.makeUserAcl();
          if ((userAcls != null) && (userAcls.length > 0)) {
            for (String resourcePrincipal: resourceAcls) {
              for (String userPrincipal: userAcls) {
                if (resourcePrincipal.equalsIgnoreCase(userPrincipal)) {
                  return;
View Full Code Here

        return;
      }
     
      boolean checkTermDocs = true;
      if (isUnfiltered) {
        MetadataAcl acl = new MetadataAcl(request.getRequestContext());
        if (acl.isPolicyUnrestricted()) {
          if (this.getNumberOfDocsConsidered() > 25000) {
            checkTermDocs = false;
          }
        }
      }
View Full Code Here

    } else {
      return "";
    }

    // ensure access to the document
    MetadataAcl acl = new MetadataAcl(reqContext);
    boolean bHasAccess = acl.hasReadAccess(reqContext.getUser(),id);
    if (!bHasAccess) {
      throw new NotAuthorizedException("Access denied.");
    }

    // read and return the xml
View Full Code Here

    PreparedStatement stCol = null;
    TermDocs termDocs = null;
    try {
    
      // determine the metadata acl policy
      MetadataAcl acl = new MetadataAcl(this.context);
      boolean bCheckAcl = !acl.isPolicyUnrestricted();
     
      // determine if collections are being used
      List<String[]> collections = null;
      CollectionDao colDao = new CollectionDao(this.context);
      boolean hasCollections = false;
View Full Code Here

     
      // filters
      Filter filter = null;
     
      // make the access control filter
      MetadataAcl acl = new MetadataAcl(reqContext);
      AuthenticationStatus auth = reqContext.getUser().getAuthenticationStatus();
      boolean bAdmin = auth.getAuthenticatedRoles().hasRole("gptAdministrator");
      if (!bAdmin && !acl.isPolicyUnrestricted()) {
        String[] aclValues = acl.makeUserAcl();
        filter = new AclFilter(Storeables.FIELD_ACL,aclValues);
      }
     
      // isPartOf filter
      filter = IsPartOfFilter.make(reqContext,filter);
View Full Code Here

  // check for an assign Acl request
  if (sAction.equalsIgnoreCase("assignAcl")) {
    ArrayList<String> selectedGroups = getActionCriteria().getMetadataAccessPolicy();
    Groups groups = Publisher.buildSelectableGroups(getRequestContext());
    if (selectedGroups != null && selectedGroups.size() > 0) {
      MetadataAcl acl = new MetadataAcl(getRequestContext());
      nRows = adminDao.updateAcl(getPublisher(), queryCriteria, acl.buildAclGroups(groups, selectedGroups));
    } else {
      nRows = adminDao.updateAcl(getPublisher(), queryCriteria, null);
    }
  }
View Full Code Here

*/
private void executeAssignAcl(ImsMetadataAdminDao adminDao, StringSet uuids,
    Groups groups, ArrayList<String> selectedGroups)
  throws ImsServiceException, SQLException, CatalogIndexException {
  ActionResult result = getActionResult();
  MetadataAcl acl = null;
  if (selectedGroups != null && selectedGroups.size() > 0) {
    if ((uuids.size() > 0) && (groups.size() > 0)) {
      acl = new MetadataAcl(getRequestContext());
      result.setNumberOfRecordsModified(adminDao.updateAcl(getPublisher(),
          uuids, acl.buildAclGroups(groups, selectedGroups)));
    } else if ((uuids.size() > 0) && (selectedGroups.size() > 0)) {
      if (selectedGroups.get(0).equalsIgnoreCase("unrestricted")) {
        result.setNumberOfRecordsModified(adminDao.updateAcl(getPublisher(),uuids, null));
      } else {
        StringBuilder sbAclXml = new StringBuilder();
View Full Code Here

     
      ImsMetadataAdminDao dao = new ImsMetadataAdminDao(context);
      String resourceTable =  context.getCatalogConfiguration().getResourceTableName();
      String resourceDataTable = context.getCatalogConfiguration().getResourceDataTableName();
      StringSet delUuids = new StringSet();
      MetadataAcl acl = new MetadataAcl(context);
      boolean bCheckAcl = !acl.isPolicyUnrestricted();
     
      StringBuilder sbIds = new StringBuilder();
      for (String sUuid: ids) {
        if (sbIds.length() > 0) sbIds.append(",");
        sbIds.append("'").append(sUuid).append("'");
View Full Code Here

  // set the ACL
  String aclXml = rs.getString(n++);
  if (aclXml != null && aclXml.trim().length() > 0) {
    record.setMetadataAccessPolicyType("Restricted");
    MetadataAcl acl = new MetadataAcl(getRequestContext());
    record.setCurrentMetadataAccessPolicy(acl.makeGroupsfromXml(allGroups,aclXml));
    record.setCurrentMetadataAccessPolicyKeys(acl.makeGroupsKeysfromXml(allGroups,aclXml));
  } else {
    record.setMetadataAccessPolicyType("Unrestricted");
    record.setCurrentMetadataAccessPolicy("Unrestricted");
    record.setCurrentMetadataAccessPolicyKeys("Unrestricted");
  }
View Full Code Here

TOP

Related Classes of com.esri.gpt.framework.security.metadata.MetadataAcl

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.