Examples of RoleNotFoundException


Examples of com.baasbox.exception.RoleNotFoundException


    public static ODocument grantPermissionToRole(String id,Permissions permission, String rolename)
        throws RoleNotFoundException, FileNotFoundException, SqlInjectionException, InvalidModelException {
      ORole role=RoleDao.getRole(rolename);
      if (role==null) throw new RoleNotFoundException(rolename);
      ODocument doc = getById(id);
      if (doc==null) throw new FileNotFoundException(id);
      return PermissionsHelper.grant(doc, permission, role);
    }
View Full Code Here

Examples of com.baasbox.exception.RoleNotFoundException


    public static ODocument revokePermissionToRole(String id,
        Permissions permission, String rolename) throws RoleNotFoundException, FileNotFoundException, SqlInjectionException, InvalidModelException  {
      ORole role=RoleDao.getRole(rolename);
      if (role==null) throw new RoleNotFoundException(rolename);
      ODocument doc = getById(id);
      if (doc==null) throw new FileNotFoundException(id);
      return PermissionsHelper.revoke(doc, permission, role);
   
View Full Code Here

Examples of com.baasbox.exception.RoleNotFoundException

    return PermissionsHelper.revoke(doc, permission, user);
  }

  public static ODocument grantPermissionToRole(String collectionName, String rid, Permissions permission, String rolename) throws RoleNotFoundException, IllegalArgumentException, InvalidCollectionException, InvalidModelException, DocumentNotFoundException {
    ORole role=RoleDao.getRole(rolename);
    if (role==null) throw new RoleNotFoundException(rolename);
    ODocument doc = get(collectionName, rid);
    if (doc==null) throw new DocumentNotFoundException(rid);
        return PermissionsHelper.grant(doc, permission, role);
  }
View Full Code Here

Examples of com.baasbox.exception.RoleNotFoundException

        return PermissionsHelper.grant(doc, permission, role);
  }

  public static ODocument revokePermissionToRole(String collectionName, String rid, Permissions permission, String rolename) throws  IllegalArgumentException, InvalidCollectionException, InvalidModelException, DocumentNotFoundException, RoleNotFoundException {
    ORole role=RoleDao.getRole(rolename);
    if (role==null) throw new RoleNotFoundException(rolename);
    ODocument doc = get(collectionName, rid);
    if (doc==null) throw new DocumentNotFoundException(rid);
    return PermissionsHelper.revoke(doc, permission, role);
  }
View Full Code Here

Examples of com.baasbox.exception.RoleNotFoundException

   * @throws RoleNotFoundException if inehritedRole does not exist
   * @throws RoleAlreadyExistsException if the 'name' role already exists
   */
  public static void createRole(String name, String inheritedRole, String description) throws RoleNotFoundException, RoleAlreadyExistsException{
    if (!RoleDao.exists(inheritedRole)) {
      RoleNotFoundException e = new RoleNotFoundException(inheritedRole + " role does not exist!");
      e.setInehrited(true);
      throw e;
    }
    if (RoleDao.exists(name)) throw new RoleAlreadyExistsException(name + " role already exists!");
    ORole newRole = RoleDao.createRole(name, inheritedRole);
    newRole.getDocument().field(FIELD_INTERNAL,false);
View Full Code Here

Examples of com.baasbox.exception.RoleNotFoundException

   * @return
   */
  public static void editRole(String name, String inheritedRole,
      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;
      }
      ORole roleIn=RoleDao.getRole(inheritedRole);
      roleDoc.field(RoleDao.FIELD_INHERITED,roleIn.getDocument().getRecord());
    }
View Full Code Here

Examples of com.baasbox.exception.RoleNotFoundException

    if (description!=null) roleDoc.field(FIELD_DESCRIPTION,description);
    roleDoc.save();
  }

  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
View Full Code Here

Examples of javax.management.relation.RoleNotFoundException

        if (!groupContainer.containsPrincipal(groupName)) {
            loadRoles(groupName, false);
        }
        if (!groupContainer.containsPrincipal(groupName)) {
            throw new RoleNotFoundException(groupName + " is not a valid group!");
        }

        ActiveDirectoryGroup group = groupContainer.retrievePrincipal(groupName);
        groupContainer.buildHierarchy(group.getOriginalDn());
        return group;
View Full Code Here

Examples of org.aperteworkflow.util.liferay.exceptions.RoleNotFoundException

            if(role != null)
              return role;
          }
         
          /* No role with given name found, throw exception */
          throw new RoleNotFoundException("No role found with given name: "+roleName);
      }
      catch(NoSuchRoleException ex)
      {
        throw new RoleNotFoundException("No role found with given name: "+roleName);
      }
      catch (PortalException e)
      {
        throw new RoleNotFoundException("Error during role ["+roleName+"]", e);
    }
      catch (SystemException e)
      {
        throw new RoleNotFoundException("Error during role ["+roleName+"]", e);
    }
    }
View Full Code Here

Examples of org.mifosplatform.useradministration.exception.RoleNotFoundException

            this.context.authenticatedUser();

            this.roleCommandFromApiJsonDeserializer.validateForUpdate(command.json());

            final Role role = this.roleRepository.findOne(roleId);
            if (role == null) { throw new RoleNotFoundException(roleId); }

            final Map<String, Object> changes = role.update(command);
            if (!changes.isEmpty()) {
                this.roleRepository.saveAndFlush(role);
            }
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.