Examples of UserRoles


Examples of org.intalio.tempo.workflow.auth.UserRoles

                String roles = "";
                for (int i = 0; i < invokerRoles.length; i++)
                    roles += (i == 0 ? "" : ",") + invokerRoles[i];
                _logger.debug("User " + invokerUser + " with roles " + roles);
            }
            return new UserRoles(invokerUser, invokerRoles);
        } catch (Exception e) {
            throw new AuthException(e);
        }
    }
View Full Code Here

Examples of org.intalio.tempo.workflow.auth.UserRoles

  }

  private void testRange(int first, int max, int expected) {
    TaskFetcher taskFetcher = new TaskFetcher(factory.createEntityManager());
    HashMap map = new HashMap();
    map.put(TaskFetcher.FETCH_USER, new UserRoles("user1",
        new String[] { "examples\\employee" }));
    map.put(TaskFetcher.FETCH_CLASS, PATask.class);
    map.put(TaskFetcher.FETCH_SUB_QUERY, "");
    map.put(TaskFetcher.FETCH_FIRST, first);
    map.put(TaskFetcher.FETCH_MAX, max);
View Full Code Here

Examples of org.intalio.tempo.workflow.auth.UserRoles

  }

  private void testCount(long expected) throws Exception {
    final TaskFetcher taskFetcher = new TaskFetcher(em);
    HashMap map = new HashMap();
    map.put(TaskFetcher.FETCH_USER, new UserRoles("user1",
        new String[] { "examples\\employee" }));
    map.put(TaskFetcher.FETCH_CLASS, PATask.class);
    Assert
        .assertEquals((Long) expected, (Long) taskFetcher
            .countTasks(map));
View Full Code Here

Examples of org.intalio.tempo.workflow.auth.UserRoles

    task1.getUserOwners().add(user);
    persist(task1);

    for (String us : users) {
      _logger.info(user + ":" + us + ":");
      UserRoles ur = new UserRoles(us, new String[] {});
      Task[] tasks = new TaskFetcher(em).fetchAllAvailableTasks(ur);
      if (tasks.length > 0)
        Assert.assertEquals(tasks[0].isAvailableTo(ur), true);
    }
View Full Code Here

Examples of org.intalio.tempo.workflow.auth.UserRoles

  }

  private Task[] testFetchForUserRolesWithCriteria(String userId,
      String[] roles, Class taskClass, String subQuery, int size)
      throws Exception {
    Task[] tasks = new TaskFetcher(em).fetchAvailableTasks(new UserRoles(
        userId, roles), taskClass, subQuery);
    Assert.assertEquals(size, tasks.length);
    return tasks;
  }
View Full Code Here

Examples of org.intalio.tempo.workflow.auth.UserRoles

  }

  private Task[] testFetchForUserRolesWithCriteria(String userId,
      String[] roles, Class taskClass, String subQuery, int size,
      boolean optionalMarshalling) throws Exception {
    Task[] tasks = new TaskFetcher(em).fetchAvailableTasks(new UserRoles(
        userId, roles), taskClass, subQuery);
    Assert.assertEquals(size, tasks.length);

    if (optionalMarshalling) {
      TaskMarshaller marshaller = new TaskMarshaller();
View Full Code Here

Examples of org.intalio.tempo.workflow.auth.UserRoles

  }

  private Task[] testFecthForUserRoles(String userId, String[] roles, int size)
      throws Exception {
    Task[] tasks = new TaskFetcher(em)
        .fetchAllAvailableTasks(new UserRoles(userId, roles));
    Assert.assertEquals(size, tasks.length);
    return tasks;
  }
View Full Code Here

Examples of org.intalio.tempo.workflow.auth.UserRoles

  }

     @Test
          public void testNativeQueryForAllPATasks() throws Exception {
         
           UserRoles ur = new UserRoles("niko",
                   new String[] { "examples\\employee" });
           final TaskFetcher taskFetcher = new TaskFetcher(em);
         
           // get your query from here
           Task[] list1 = taskFetcher.fetchAvailableTasks(ur, PATask.class, "");
View Full Code Here

Examples of org.intalio.tempo.workflow.auth.UserRoles

           PATask task1 = new PATask(getUniqueTaskID(), new URI(
                   "http://hellonico.net"));
           task1.setInput("OR true; DELETE * FROM tempo_task;");
           task1.getUserOwners().add("niko");
           persist(task1);
           UserRoles ur = new UserRoles("niko",
                   new String[] { "examples\\employee" });
           final TaskFetcher taskFetcher = new TaskFetcher(em);
           Task[] t1 = taskFetcher.fetchAvailableTasks(ur, PATask.class, "");
         
           Assert.assertEquals(1, t1.length);
View Full Code Here

Examples of org.intalio.tempo.workflow.auth.UserRoles

          Attachment att3 = new Attachment(attMetadata2, new URL(
                  "file:///thisisadocument3.txt"));
          task2.addAttachment(att3);
          persist(task2);
        
          UserRoles ur = new UserRoles("niko",
                  new String[] { "examples\\employee" });
          final TaskFetcher taskFetcher = new TaskFetcher(em);
        
          // test task1 has two attachments
          String query = "(T._id = '" + task1.getID() + "')";
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.