Package com.orientechnologies.orient.core.metadata.security

Examples of com.orientechnologies.orient.core.metadata.security.OUser.save()


      OUser oUser = iDatabase.getMetadata().getSecurity().getUser(dbUser);
      if (oUser == null) {
        iDatabase.getMetadata().getSecurity().createUser(dbUser, dbPasswd, new String[] { ORole.ADMIN });
      } else {
        oUser.setPassword(dbPasswd);
        oUser.save();
      }
    }
    OLogManager.instance().info(this, "Created database '%s' of type '%s'", iDatabase.getURL(),
        iDatabase.getStorage() instanceof OStorageLocal ? "local" : "memory");
View Full Code Here


      OUser oUser = iDatabase.getMetadata().getSecurity().getUser(dbUser);
      if (oUser == null) {
        iDatabase.getMetadata().getSecurity().createUser(dbUser, dbPasswd, new String[] { ORole.ADMIN });
      } else {
        oUser.setPassword(dbPasswd);
        oUser.save();
      }
    }
    OLogManager.instance().info(this, "Created database '%s' of type '%s'", iDatabase.getURL(),
        iDatabase.getStorage() instanceof OStorageLocal ? "local" : "memory");
View Full Code Here

      OUser oUser = iDatabase.getMetadata().getSecurity().getUser(dbUser);
      if (oUser == null) {
        iDatabase.getMetadata().getSecurity().createUser(dbUser, dbPasswd, new String[] { ORole.ADMIN });
      } else {
        oUser.setPassword(dbPasswd);
        oUser.save();
      }
    }
    OLogManager.instance().info(this, "Created database '%s' of type '%s'", iDatabase.getURL(),
        iDatabase.getStorage() instanceof OStorageLocal ? "local" : "memory");
View Full Code Here

      OUser oUser = iDatabase.getMetadata().getSecurity().getUser(dbUser);
      if (oUser == null) {
        iDatabase.getMetadata().getSecurity().createUser(dbUser, dbPasswd, new String[] { ORole.ADMIN });
      } else {
        oUser.setPassword(dbPasswd);
        oUser.save();
      }
    }
    OLogManager.instance().info(this, "Created database '%s' of type '%s'", iDatabase.getURL(),
        iDatabase.getStorage() instanceof OStorageLocal ? "local" : "memory");
View Full Code Here

      ORole oldORole=RoleDao.getRole(oldRole);
      //TODO: update role
      OUser ouser=DbHelper.getConnection().getMetadata().getSecurity().getUser(username);
      ouser.getRoles().remove(oldORole);
      ouser.addRole(newORole);
      ouser.save();
      profile.save();
      profile.reload();

      return profile;
    }catch (OSerializationException e){
View Full Code Here

  public static void updateDefaultUsers() throws Exception{
    if (Logger.isTraceEnabled()) Logger.trace("Method Start");
    ODatabaseRecordTx db = DbHelper.getConnection();
    OUser user=db.getMetadata().getSecurity().getUser(BBConfiguration.getBaasBoxUsername());
    user.setPassword(BBConfiguration.getBaasBoxPassword());
    user.save();

    user=db.getMetadata().getSecurity().getUser(BBConfiguration.getBaasBoxAdminUsername());
    user.setPassword(BBConfiguration.getBaasBoxAdminPassword());
    user.save();
View Full Code Here

    user.setPassword(BBConfiguration.getBaasBoxPassword());
    user.save();

    user=db.getMetadata().getSecurity().getUser(BBConfiguration.getBaasBoxAdminUsername());
    user.setPassword(BBConfiguration.getBaasBoxAdminPassword());
    user.save();

    if (Logger.isTraceEnabled()) Logger.trace("Method End");
  }

View Full Code Here

  public void disableUser(String username) throws UserNotFoundException, OpenTransactionException{
    db = DbHelper.reconnectAsAdmin();
    OUser user = db.getMetadata().getSecurity().getUser(username);
    if (user==null) throw new UserNotFoundException("The user " + username + " does not exist.");
    user.setAccountStatus(STATUSES.SUSPENDED);
    user.save();
    //cannot resume the old connection because now the user is disabled
  }
 
  public void enableUser(String username) throws UserNotFoundException, OpenTransactionException{
    db = DbHelper.reconnectAsAdmin();
View Full Code Here

  public void enableUser(String username) throws UserNotFoundException, OpenTransactionException{
    db = DbHelper.reconnectAsAdmin();
    OUser user = db.getMetadata().getSecurity().getUser(username);
    if (user==null) throw new UserNotFoundException("The user " + username + " does not exist.");
    user.setAccountStatus(STATUSES.ACTIVE);
    user.save();
  }

}
View Full Code Here

       OUser oUser = iDatabase.getMetadata().getSecurity().getUser(dbUser);
       if (oUser == null) {
         iDatabase.getMetadata().getSecurity().createUser(dbUser, dbPasswd, new String[] { ORole.ADMIN });
       } else {
         oUser.setPassword(dbPasswd);
         oUser.save();
       }
     }

     OLogManager.instance().info(this, "Created database '%s' of type '%s'", iDatabase.getName(),
         iDatabase.getStorage() instanceof OAbstractPaginatedStorage ? iDatabase.getStorage().getType() : "memory");
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.