Package ca.carleton.gcrc.couch.client

Examples of ca.carleton.gcrc.couch.client.CouchDbSecurityDocument


      actions.setServerKey(serverKey);
    }
   
    // Add atlas role to access user database
    try {
      CouchDbSecurityDocument securityDoc = userDb.getSecurityDocument();
      Collection<String> adminRoles = securityDoc.getAdminRoles();
     
      boolean updateRequired = false;

      // <atlas>_administrator
      {
        String targetRole = atlasName + "_administrator";
        if( false == adminRoles.contains(targetRole) ) {
          securityDoc.addAdminRole(targetRole);
          updateRequired = true;
        }
      }

      // administrator
      {
        String targetRole = "administrator";
        if( false == adminRoles.contains(targetRole) ) {
          securityDoc.addAdminRole(targetRole);
          updateRequired = true;
        }
      }

      if( updateRequired ) {
View Full Code Here


   
    // Fix member roles on submission database
    try {
      if( null != submissionDesign ) {
        CouchDb submissionDb = submissionDesign.getDatabase();
        CouchDbSecurityDocument secDoc = submissionDb.getSecurityDocument();
       
        boolean updateRequired = false;
       
        // Administrator role
        {
          String adminRole = atlasName + "_administrator";
          if( false == secDoc.getAdminRoles().contains(adminRole) ) {
            secDoc.addAdminRole(adminRole);
            updateRequired = true;
          }
        }
       
        // Vetter role
        {
          String vetterRole = atlasName + "_vetter";
          if( false == secDoc.getMemberRoles().contains(vetterRole) ) {
            secDoc.addMemberRole(vetterRole);
            updateRequired = true;
          }
        }
       
        if( updateRequired ){
View Full Code Here

   
    actions = new UserServletActions(userDb);
   
    // Add atlas role to access user database
    try {
      CouchDbSecurityDocument securityDoc = userDb.getSecurityDocument();
      Collection<String> adminRoles = securityDoc.getAdminRoles();
     
      boolean updateRequired = false;

      // <atlas>_administrator
      {
        String targetRole = atlasName + "_administrator";
        if( false == adminRoles.contains(targetRole) ) {
          securityDoc.addAdminRole(targetRole);
          updateRequired = true;
        }
      }

      // administrator
      {
        String targetRole = "administrator";
        if( false == adminRoles.contains(targetRole) ) {
          securityDoc.addAdminRole(targetRole);
          updateRequired = true;
        }
      }

      if( updateRequired ) {
View Full Code Here

        throw new Exception("Unable to upload submission design document", e);
      }

      // Fix member roles on submission database
      try {
        CouchDbSecurityDocument secDoc = submissionCouchDb.getSecurityDocument();
       
        boolean updateRequired = false;
       
        // Administrator role
        {
          String adminRole = atlasProperties.getAtlasName() + "_administrator";
          if( false == secDoc.getAdminRoles().contains(adminRole) ) {
            secDoc.addAdminRole(adminRole);
            updateRequired = true;
          }
        }
       
        // Vetter role
        {
          String vetterRole = atlasProperties.getAtlasName() + "_vetter";
          if( false == secDoc.getMemberRoles().contains(vetterRole) ) {
            secDoc.addMemberRole(vetterRole);
            updateRequired = true;
          }
        }
       
        if( updateRequired ){
View Full Code Here

      actions.setServerKey(serverKey);
    }
   
    // Add atlas role to access user database
    try {
      CouchDbSecurityDocument securityDoc = userDb.getSecurityDocument();
      Collection<String> adminRoles = securityDoc.getAdminRoles();
     
      boolean updateRequired = false;

      // <atlas>_administrator
      {
        String targetRole = atlasName + "_administrator";
        if( false == adminRoles.contains(targetRole) ) {
          securityDoc.addAdminRole(targetRole);
          updateRequired = true;
        }
      }

      // administrator
      {
        String targetRole = "administrator";
        if( false == adminRoles.contains(targetRole) ) {
          securityDoc.addAdminRole(targetRole);
          updateRequired = true;
        }
      }

      if( updateRequired ) {
View Full Code Here

TOP

Related Classes of ca.carleton.gcrc.couch.client.CouchDbSecurityDocument

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.