Package com.baasbox.exception

Examples of com.baasbox.exception.RoleNotModifiableException


      String description, String newName) throws RoleNotFoundException, RoleNotModifiableException {

    if (!RoleDao.exists(name)) throw new RoleNotFoundException(name + " role does not exist!");
    ORole role = RoleDao.getRole(name);
    ODocument roleDoc=role.getDocument();
    if (roleDoc.field(FIELD_MODIFIABLE)==Boolean.FALSE) throw new RoleNotModifiableException(name + " role is not modifiable");
    if (!StringUtils.isEmpty(inheritedRole)) {
      if (!RoleDao.exists(inheritedRole)) {
        RoleNotFoundException e = new RoleNotFoundException(inheritedRole + " role does not exist!");
        e.setInehrited(true);
        throw e;
View Full Code Here


  }

  public static void delete(String name) throws RoleNotFoundException, RoleNotModifiableException {
    if (!RoleDao.exists(name)) throw new RoleNotFoundException(name + " role does not exist!");
    ORole role = RoleDao.getRole(name);
    if (role.getDocument().field(FIELD_INTERNAL)==Boolean.TRUE) throw new RoleNotModifiableException("Role " + name + " cannot be deleted. It is declared like 'internal'");
    //retrieve the users belonging to that role
    UserService.moveUsersToRole(name,DefaultRoles.REGISTERED_USER.toString());
    //delete the role
    RoleDao.delete(name);
  }
View Full Code Here

TOP

Related Classes of com.baasbox.exception.RoleNotModifiableException

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.